In minute 42:23 instead of using both map and filter to get the updated course you can do it like this: const updateCourseTopic = arg => { let id = arg.id; let topic = arg.topic; let updatedCourse; coursesData.filter(course => { if(course.id === id){ course.topic = topic; updatedCourse = course; } return course; }); return updatedCourse; } Where you are only using filter on coursesData array
Thank you Sebastian for this informative primer on GQL! It's not hard to predict that it would/should replace REST easily specially in newly built apps.
Sorry, very basic question here.. so express.js runs on top of node.js.. but to use GraphQL you need another server, express-graphql? How does graphql-yoga or apollo-server-express fit in? For example, 'npm install' is used to install node.js modules, yet things like graphql-yoga are installed using 'yarn'.. so I assume it's not running on Node.js?
express-graphql is middleware for express, and express itself is nothing more than a frame work that makes your life easier than having to write server side code all from scratch. Node.js is an environment that allows javascript to run on a server.
for everyone have error express_graphql is not a function only change it to be like : const { graphqlHTTP } = require("express-graphql"); and in app.use write like: app.use( "/graphql", graphqlHTTP({ schema: schema, rootValue: root, graphiql: true, }) ); I hope it helpful
in the newer express-graphql package use ``` const { graphqlHTTP } = require('express-graphql'); ``` *edit* : also you will need an older version of graphql i think 15.3.0
Great video Sebastian. How would you extend this for an example where the data is not static and defined within the Server implementation but being called from a database? Thanks. Tam.
chuck nor You can use an ORM at the resolver step. Nothing changes about how you store and retrieve data-graphql doesn’t care about that. It’s just replacing your rest api If I’m wrong or mislead please correct me I’m very interested in this
Cool tutorial. Small suggestions would be use the shorthand object properties like: {schema, rootValue:...} instead of {schema:schema, etc...} which is redundant from ES6. Also replacing var with const is considered a good practice.
I heard about graphql from the CodingBlocks podcast and this looks absolutely amazing. I can’t wait to get my hands dirty with this
Thank you very much for this video! I've gone from 0 to having a good enough understanding on implementing a graphql API
Excellent GraphQL server configuration tutorial here, with several query structures to show GraphQL query configurations; *thank you, sir!*
Clear and concise tutorial..thanks man!
great example, I was confused but now I very clear how graphQL works, thanks dude.
Thanks very much again for this awesome introduction to GraphQL!!!
Excellent video, this is exactly what I needed to get familiar with GraphQL and Express! Such a great way to teach getting started...
clear and clean as every time.....another awesome tutorial
The best tutorial! Thanks a lot for the help!
so It's still working, happy to know it! hehe
Excellent demonstration...very clear explanation...Thanks
Excellent tutorial. Appreciate your excellent work.
Love it! Nice video. Have been looking for a n00b's walkthrough on implementing GraphQL and this was perfect.
Thanks RealToughCandy!
@@codingthesmartway Isn't it a sarcasm?
Very nice and easy to understand and follow.
Great Graphql Introduction video
In minute 42:23 instead of using both map and filter to get the updated course you can do it like this:
const updateCourseTopic = arg => {
let id = arg.id;
let topic = arg.topic;
let updatedCourse;
coursesData.filter(course => {
if(course.id === id){
course.topic = topic;
updatedCourse = course;
}
return course;
});
return updatedCourse;
}
Where you are only using filter on coursesData array
nicely explained.. very well does the job!
Thank you Sebastian for this informative primer on GQL! It's not hard to predict that it would/should replace REST easily specially in newly built apps.
great tutorial as usual
Good explanation ... Nice video :)
Very Very good !
Sorry, very basic question here.. so express.js runs on top of node.js.. but to use GraphQL you need another server, express-graphql? How does graphql-yoga or apollo-server-express fit in?
For example, 'npm install' is used to install node.js modules, yet things like graphql-yoga are installed using 'yarn'.. so I assume it's not running on Node.js?
express-graphql is middleware for express, and express itself is nothing more than a frame work that makes your life easier than having to write server side code all from scratch. Node.js is an environment that allows javascript to run on a server.
Thank you for this excellent tut. GraphQL finally makes sense! :)
Subscribed
It helped me a lot, Thank you
Great ! Exactly what am looking for in so many junks (y)
for everyone have error express_graphql is not a function only change it to be like :
const { graphqlHTTP } = require("express-graphql");
and in app.use write like:
app.use(
"/graphql",
graphqlHTTP({
schema: schema,
rootValue: root,
graphiql: true,
})
);
I hope it helpful
in the newer express-graphql package use ``` const { graphqlHTTP } = require('express-graphql'); ```
*edit* : also you will need an older version of graphql i think 15.3.0
Great video Sebastian. How would you extend this for an example where the data is not static and defined within the Server implementation but being called from a database? Thanks. Tam.
chuck nor
You can use an ORM at the resolver step. Nothing changes about how you store and retrieve data-graphql doesn’t care about that. It’s just replacing your rest api
If I’m wrong or mislead please correct me I’m very interested in this
Cool tutorial. Small suggestions would be use the shorthand object properties like: {schema, rootValue:...} instead of {schema:schema, etc...} which is redundant from ES6. Also replacing var with const is considered a good practice.
is possible to make Appllo like a controller in sequence diagram ?
Thanks a lot brother. well explained
why do you use var?
sir how can we add different middlewares to graphql like isLoggedIn, hasPermission etc.
Hey sabastian, I have a request dude, please make a authentication tut using express graphql and react please. I'm stuck!
I'm waiting for your response
Thanks a lot it is a very helpful video
Really great job.. love u
"Hello Wold!" xd
"Unknow type int" error. Please help!
Capital I in Int
Quick update
Change this var express_graphql = require('express-graphql')
To var express_graphql = require('express-graphql').graphqlHTTP;
Good video, but how do I get the result to display on the frontend?
💻 Website: codingthesmartway.com/
🎓 Top Web Development Online Courses: codingthesmartway.com/courses/
du bischt so n hammer erklärer, aber dein Englisch klingt sehr sehr deutsch :D Greets from Germany.
I think this tutorial still need to add babel and better file organization
@迷彩网后 Please clarify: "better file organization", be specific
hi
just a tips:
var root = {
message: () => {
return "Hello World";
}
};
Need to work on your "a"s and "um"s.
damn