GraphQL Tutorial #7 - GraphQL Schema

preview_player
Показать описание
Hey all, in this GraphQL tutorial, I'll explain exactly what a GraphQL schema ias and we we need to create one. We'll also start to flesh out an object type (Book) inside the schema file.

----- COURSE LINKS:

======== Other Tutorials =========

----- NODE.JS TUTORIALS

----- MONGODB TUTORIALS

----- REACT TUTORIALS

======== Social Links ==========

Рекомендации по теме
Комментарии
Автор

Dude, i genuinely love you. You are a living legend.

hellsing
Автор

i really like this kind of slow type of teaching. highly effective for me😄

everythingdivi
Автор

this is clearly best explaination about GraphQLObjectType, thank you master

mojtabaabasimoghadam
Автор

Bro, I found an error in your code. Might be it is raising due to library updating.

const { graphqlHTTP } = require('express-graphql');

chetanpl
Автор

My question is, how do you learn all of this to teach us.

MattDuarte
Автор

Has this gone out of date? This is very different to graphql official tutorial. Why are we not defining type using 'type Book' { author: String! } etc, ?

saradevanney
Автор

Thanks for this video it really helped me a alot

dhruvkumar-brlp
Автор

Hey Ninja, why do you construct the schema programmatically ? What is the advantage instead of buildSchema and a root object, like in the examples of graphql.js doc ?

scylk
Автор

Is this out of date now? My schema followed from a 2021 book is much different

ItalianVoid
Автор

I was wondering, why didn't you use apollo-server for writing the schema?

kerendn
Автор

Hi!
First of all thanks a lot for the time you spend on these tutorials, they're really helpful and really well explained.

I'm facing a problem with the schema...

I'd like to separate two schema in two different files to have a better organization in my code, but I can't figure out how to merge them together to insert both of them in the graphqlHTTP function.

I found something about mergeTypes from merge-graphql-schemas

here's few line...



// schemas/index.js

const userSchema = require('./user');
const bookSchema = require('./book');
const { mergeTypes } =

const schemas = [
userSchema,
bookSchema
];

module.exports = mergeTypes(schemas, { all: true });



//app.js

const express = require('express');
const graphqlHTTP = require('express-graphql');
const schemas = require('./schemas/index');

const app = express();

app.use('/graphql', graphqlHTTP({
schema: schemas,
graphiql: true
}));

app.listen(3333, () => {
console.log('Server is listening on port 3333');
})



I hope you can help me figure out how to help me to solve this...

Thanks in advance!

romainwidmer
Автор

Please make tutorial on mongodb all topics beginning to advanced.

hkdelhivlogs
Автор

Is there anyway you can show what the schema file would look like as a .graphql file instead of a JS file? Thanks for the great tutorials!

noahpeden
Автор

Does anyone know why we set-up the fields function as:

fields: () => ({...})

as opposed to:

fields: () => {...}

Why does the round brackets surround the curly braces?

speculativesapient
Автор

Question about how we're importing / requiring: If you're going to use ES6 features for "destructuring", why not just use the ES6 imports statement? I.E., why not 'import {GraphQLObjectType, GraphQLString} from './graphql'' instead of the multiple require statements? Genuinely curious if there's a tradeoff in usage, or if it's just a stylistic thing and it doesn't matter, or what.

WesAkers
Автор

This is old and doesn't work with latest version of express-graphql, typescript, and imports verse require. :(

AutisticThinker
Автор

Which theme are you using in your IDE?

ayushshekhar
Автор

Greate tutorial. Apollo server please?

andrienpecson
Автор

Anyone else noticed that he's using only constants? hahaha

arturo
visit shbcf.ru