Amazing tutorial. I was following a paid tutorial and kept running into issues, so I switched to this one. Thank you for saving me so much time! I also appreciated how you zoomed in to make sure the code is clearly visible. There are many tutorials with good content but that I end up not watching because the code is way too small.
You are an amazing instructor. Very organized course with a nice depth and great breadth if you want to quickly grow up your knowledge on gql from scratch.
Laith! Can't tell you how much new technologies you introduced me after finishing college 😅 DevOps, testing, graphql, redis so much will be in queue. Thanks a lot
THANK YOU SO MUCHHHHHH FOR THIS COURSE, I LOVEEDDD IT ❤️ XD The explaination was so easy to understand, Thank youuuuuu At least now I know my way around GraphQL haha, time to play with it more.
Thank you Laith for this precious crash course. Indeed, it gives a big picture of this new paradigm. I am just wondering if Appollo/Client querie are performed in an async way under the hood, or something else. Or should we have to put them in a useEffect... It would be nice to clarify this point
Dude, very good video. Helped me a lot! And I saw you had another ones for typescript and testing I need those like a salt for me to become a better developer!! I appriciate a lot that its acctually recorded 2021 - so up to date. Also loved that you showed best practices on how to separate code so I dont have it in one file. If you could extend this tutorial with ORM for database and authentification I think that would help a lot of people to setup complete basic server for their apps. Meanwhile Ill have to figureout those myself. Again thanks a lot keep doing good job. Post some place where I can support you with money.
Thank you for your response. I'll be making a few videos about ORMs and one will be with GraphQL. Also thank you for your generosity, but I am not accepting money at the moment
hey, I have a question. I am getting an error if i tried using resolver Category: animals:{} which says Query.Category defined in resolvers, but not in schema. i have done it in different way which is category: (parent, args, ctx) => categories.find((cat) => { cat.animals = animals.filter((animal) => animal.category == cat.id); return cat.slug === args.slug; }), but the way you did it looks much cleaner and i was wonder what could i be missing. Thanks for the help.
Thanks a lot bro 👌. I have a doubt. In mongodb we also have schema, and queries for crud operations. Do we need to use graphql for better querying? Or the one in mongodb is enough?
You have excellent content and excellent way to teach i really like the way you do it!! Keep it up Just a tip: for parameters that you dont use inside your arrow functions in resolvers you can put a low dash (_), so if you dont use parent you put a low dash and if you dont use both first and second (parent and args) you can put a low dash to replace the first and double low dash to replace the second
great tutorial. I'm wondering if the useQuery hook can take a dependency array or something so that the landing page component re-renders after adding an animal with useMutation. I'll have to go look it up.
Turns out the solution (or at least a solution) is to use 'refetchQueries': ----- addAnimal({ variables: { image: "ostrich", category: "1", title: "This is a really cool ostrich", stock: 13, price: "32,333", description: ["long neck", "fast legs"], rating: 3.5, slug: "ostrich" }, refetchQueries: [{ query: ANIMALS_QUERY }] // This will refetch the animals, including the ostrich })}>Add an Ostrich -----
One useful tip: I guess it is better to write like this "server.listen({port: process.env.PORT || 4000}).then(({url}) => {//...})" This helps when you are deploying this server to production like heroku or Vercel
For removeAnimal mutation, I tried to override the context.animals like this.. but it didn't work. Why so? context.animals = context.animals.filter(animal => animal.id !== args.id)
that should work. imho... maybe try animals = context.animals.filter(animal => animal.id !== args.id) without context.animals at the beginning. thats how i wrote it but idk maybe it doesnt? this works for duplicates you want deleted also where as the other way (using findIndex) just removes the first match. this way is better i think
i think context refers to the main hub of data but wont rewrite it. perhaps context.animals is just a reference. like i mentioned try -----> animals = context.animals.filter(animal => animal.id !== args.id)
did you return context.animals after? did you already de-structure {animals} from the context argument? its probably the thing i mentioned above OR one of these two problems.
context was passed as an argument to the resolver so you're modifying a copy of animals not the original animals. i.e you're changing the context itself not the animals array
kinda wish u taught this without a slug being the parameters/variables though tbh... cuz im havbing trouble pluggin in a regular variable with lets say an input box value.. can anyone help?
i also think you should write the data BEFORE defining schemas. a few times you write the queries and schemas and then just match the specifications and types accordingly and write the correct data. seems a bit backwards... nonetheless an amazing tutorial. consider me a new subscriber!!!
i don't like how you removed in your remove animal resolver. lots of unnecessary code and steps to me. also doesn't account for possible duplicates. findIndex just returns the first match. why not return a filtered new set of animals without the ones passed in as arguments? nonetheless i learned about findIndex because of this tutorial! haha removeAnimal: (parent, { id }, {animals})=>{ animals=animals.filter(anim=>anim.id!==id); return animals }
The video is generally good , but I guess you are not aJavascript developer ? I mean you get stuck on some very basic language structure on 3 lines of code ?
u need to take a step back if you don't know how splice or find works. no offense. but you are rushing your learning.... learn the fundamentals of JS first
@@antonkrasov yeah lol ok phew. tbh man i bet you there are people out there doing that. ive seen people learn react before learning what a frickin array is LOL
This is one of the best tutorial on youtube on graphql.
This was the best resource i've found to date explaining graphql to a beginner. thank-you very much.
Amazing tutorial. I was following a paid tutorial and kept running into issues, so I switched to this one. Thank you for saving me so much time! I also appreciated how you zoomed in to make sure the code is clearly visible. There are many tutorials with good content but that I end up not watching because the code is way too small.
I'm addicted to your channel. Great work.
wow honestly from all the programming youtubers, you have the best pedagogy :) please never stop teaching us :)
Hey Laith, After watching GraphQL video you became one of my favorite TH-camr in IT industry. GREAT && FANTASTIC JOB. Love from INDIA.
You are an amazing instructor. Very organized course with a nice depth and great breadth if you want to quickly grow up your knowledge on gql from scratch.
I have spent 2 days on this course and got a lot out of it thank you very much
If you could joom in the vscode window, it'll be great. Keep up making the crash courses buddy, they're very helpful.
Laith! Can't tell you how much new technologies you introduced me after finishing college 😅 DevOps, testing, graphql, redis so much will be in queue. Thanks a lot
THANK YOU SO MUCHHHHHH FOR THIS COURSE, I LOVEEDDD IT ❤️ XD
The explaination was so easy to understand, Thank youuuuuu
At least now I know my way around GraphQL haha, time to play with it more.
awesome 🙌. Thanks for making this techii vdo's. Best vdo ever seen for grapgQL with all necessary concept has been covered.
This tutorial saved me a lot of time. Thank you!
this course is fuckin amazing man. props. ITS FINALLY CLICKING AFTER A FEW DAYS
Hands down best tutorial on graphql
fantastic tutorial. too many out there not going in depth like this. one hour in and learned a lot! will continue tmrw :)
Please create more awesome tutorials like this 👍😁😁
The intro is so cool, Thanks for the course
Thank you! You are the best teacher on youtube!
you are so underrated! and I love you
love the intro 😂 great content would love to see more in the future :D
This is very clear and concise. It is my great plesant to spend time waching your tutorial.
Thank you Laith for this precious crash course. Indeed, it gives a big picture of this new paradigm. I am just wondering if Appollo/Client querie are performed in an async way under the hood, or something else. Or should we have to put them in a useEffect... It would be nice to clarify this point
Dude, very good video. Helped me a lot! And I saw you had another ones for typescript and testing I need those like a salt for me to become a better developer!! I appriciate a lot that its acctually recorded 2021 - so up to date. Also loved that you showed best practices on how to separate code so I dont have it in one file. If you could extend this tutorial with ORM for database and authentification I think that would help a lot of people to setup complete basic server for their apps. Meanwhile Ill have to figureout those myself. Again thanks a lot keep doing good job. Post some place where I can support you with money.
Thank you for your response. I'll be making a few videos about ORMs and one will be with GraphQL. Also thank you for your generosity, but I am not accepting money at the moment
@Finelf Ben awad has tutorials on graphql with orm and auth sessions, check him out
@@EverAfterBreak2 yeah i know Ben
Just awesome. Excellent instructor!
hey, I have a question. I am getting an error if i tried using resolver Category: animals:{} which says Query.Category defined in resolvers, but not in schema. i have done it in different way which is category: (parent, args, ctx) =>
categories.find((cat) => {
cat.animals = animals.filter((animal) => animal.category == cat.id);
return cat.slug === args.slug;
}),
but the way you did it looks much cleaner and i was wonder what could i be missing.
Thanks for the help.
Very well explained! I just subscribed!
can we ask what the difference would be between react and nextjs ? in this case ?
Saved me a lot of time. Thank you so much
Hi, Awesome. Please check, this video is in the unlisted group playlist. Please Change it. Thanks for the awesome course
Just subscribed, your way of explanation is Awesome sir👏👏 thanks much🙏🙏🙏
I sincerely appreciate your generosity. Thank you!
Thanks a lot bro 👌. I have a doubt. In mongodb we also have schema, and queries for crud operations. Do we need to use graphql for better querying? Or the one in mongodb is enough?
love your videos mate
Great tutorial! Just wondering, although the course is about 3 hours, on an average, how long did people take to finish this?
You have excellent content and excellent way to teach i really like the way you do it!!
Keep it up
Just a tip: for parameters that you dont use inside your arrow functions in resolvers you can put a low dash (_), so if you dont use parent you put a low dash and if you dont use both first and second (parent and args) you can put a low dash to replace the first and double low dash to replace the second
great course, just finished it! top quality! it would have been better if you did the server side with mongodb or some sort of db
great tutorial. I'm wondering if the useQuery hook can take a dependency array or something so that the landing page component re-renders after adding an animal with useMutation. I'll have to go look it up.
Turns out the solution (or at least a solution) is to use 'refetchQueries':
-----
addAnimal({
variables: {
image: "ostrich",
category: "1",
title: "This is a really cool ostrich",
stock: 13,
price: "32,333",
description: ["long neck", "fast legs"],
rating: 3.5,
slug: "ostrich"
},
refetchQueries: [{ query: ANIMALS_QUERY }] // This will refetch the animals, including the ostrich
})}>Add an Ostrich
-----
the best lessons which I ever saw
Thanks so much for all the hard work! Great job!
Great tutorial! Could you please extend this video for authentication/authorization?
Great content. I have an interview about this. Will update with the outcome 😂
when do you come to the reigon?
Thank you so much :) Awesome course. It helped a lot.
One useful tip: I guess it is better to write like this "server.listen({port: process.env.PORT || 4000}).then(({url}) => {//...})"
This helps when you are deploying this server to production like heroku or Vercel
Awesome video, but could you use a larger font for vscode next time?
2:10 im dying 😂😂 this is great
Awesome tutorial !!!! I am not thanking you because if I thank you that is too little for you. we want to more and more tutorial from you❤️
Great tutorial! Thanks!
keep going this is a good idea
@laith you are amazing, like totally
Aye thank you, glad you enjoy my stupid projects
Great introduction
For removeAnimal mutation, I tried to override the context.animals like this.. but it didn't work. Why so?
context.animals = context.animals.filter(animal => animal.id !== args.id)
that should work. imho... maybe try animals = context.animals.filter(animal => animal.id !== args.id) without context.animals at the beginning. thats how i wrote it but idk maybe it doesnt? this works for duplicates you want deleted also where as the other way (using findIndex) just removes the first match. this way is better i think
i think context refers to the main hub of data but wont rewrite it. perhaps context.animals is just a reference. like i mentioned try -----> animals = context.animals.filter(animal => animal.id !== args.id)
did you return context.animals after? did you already de-structure {animals} from the context argument? its probably the thing i mentioned above OR one of these two problems.
context was passed as an argument to the resolver so you're modifying a copy of animals not the original animals. i.e you're changing the context itself not the animals array
@@collins4359 heehee 420 blaze it bro
kinda wish u taught this without a slug being the parameters/variables though tbh... cuz im havbing trouble pluggin in a regular variable with lets say an input box value.. can anyone help?
i also think you should write the data BEFORE defining schemas. a few times you write the queries and schemas and then just match the specifications and types accordingly and write the correct data. seems a bit backwards... nonetheless an amazing tutorial. consider me a new subscriber!!!
Thank you for your great tutorial.
Great explanation
Thank you, It helped a lot.
very clean, thanks
Thank you! The course is very good and well explained, and you are fun ahahahahaahaha
Great Work!
Thank you for this tutorial.
Спасибо за урок
Thank you. 🙏🏻
Thank you for this tutorial :) Keep it up.. Subscriber++
1:34:33 i just lose my braincells everytime I try to understand this code
@1:25:15 lol
love the video, my suggestion pls install prettier it is painful to watch...
1:28:00 you forgot to cut fail
Amazing
1 dislike is from rest api
Great
If you ever go on udemy I would buy your courses bro!
i might go a little in the future. You better be my first customer
@@laithacademy great, sure I will be the first haha.
Stay away from udemy. It will damage your brain. :)
@@MaksymMinenko in what way?
nice
사랑해요
May I know, how old are you, author? Sincerely, I`m person from Siberia )))
i don't like how you removed in your remove animal resolver. lots of unnecessary code and steps to me. also doesn't account for possible duplicates. findIndex just returns the first match. why not return a filtered new set of animals without the ones passed in as arguments? nonetheless i learned about findIndex because of this tutorial! haha
removeAnimal: (parent, {
id
}, {animals})=>{
animals=animals.filter(anim=>anim.id!==id);
return animals
}
also every time you run that mutation it will just delete one animal no matter wat... idk if thats best way to write that mutation tbh
Amazon really slacking on their exotic pet market game
Yes, that's why I'll offer aminazon to them for 25M
alt+shift+F
The video is generally good , but I guess you are not aJavascript developer ? I mean you get stuck on some very basic language structure on 3 lines of code ?
You also do not know such people who came to learn how graphql works, but do not know how find and splice work?))
u need to take a step back if you don't know how splice or find works. no offense. but you are rushing your learning.... learn the fundamentals of JS first
@@BobbyBundlez this was a sarcasm sir )
@@antonkrasov yeah lol ok phew. tbh man i bet you there are people out there doing that. ive seen people learn react before learning what a frickin array is LOL
dude called a chameleon a chalamander. lmfaooo this is not pokemon. u mean charmander? LOL
lol, was wondering when someone gonna catch that
@@laithacademy amazing tutorial my man. U legit gave me more worth this week than WEEKS of tutorials on graphql and Apollo. Thank you.
Thank you. 🙏🏻