Look at this issue in stackoverflow stackoverflow.com/questions/62760975/graphqlhttp-is-not-a-function I solved it by uninstalling express-graphql and installing express-graphql@0.9.0
Every word you say carries a meaning, it's very precise and logical. Wonderful. I keep having to rewatch your videos to fully understand your knowledge.
Prior to v0.10.0, you could use var graphqlHTTP = require('express-graphql'); After v0.10.0, you need to use var { graphqlHTTP } = require('express-graphql');
If someone gets an error saying graphqlHttp is not a function replace this line const graphqlHttp = require('express-graphql'); with const graphqlHttp = require('express-graphql').graphqlHTTP;
@@marcellosanagustin670 'graphqlHttp' needs to be destructured, so you could also import it this way: const { graphqlHttp } = require('express-graphql'); basicly, it's not exported from the node module by default ;D
If you guys are getting the graphqlHttp is not a function, leave the import as: const graphqlHttp = require('express-graphql'); however, change the app.use from app.use("/graphql", graphqlHttp({ TO app.use("/graphql", graphqlHttp.graphqlHTTP({
instead of doing like this, destructure it directly in es6 import { graphqlHTTP } from "express-graphql"; and in old const { graphqlHTTP } = require('express-graphql')
Max you're awesome! Your Udemy and TH-cam courses are all incredibly easy to follow and you make learning any new technology exciting and fun. I have two questions: 1). I'm visiting Munich in August, do you recommend anywhere to check out while I'm there? 2). Do you ever give talks around Europe? I would love to see you if you ever came to the UK. Thanks again for the great content!
Thanks a million for this awesome feedback, it really makes me happy to read that you like what I'm doing :) 1.) Definitely visit some beer gardens (Hirschgarten for example), the English Garden and if you got a car some of the seas around Munich in summer 2.) At the moment no, I also got no plans to do so in the near future, but we'll see
Hi Max! So I learnt defining my GraphQL schema (query, mutation and resolvers as GraphQLObjectType) with a GraphQLSchema object which seemed more JavaScript friendly than a template literal. Is it any different than the way you implemented it in this video? 🤔
ofc im late but any reason? EDIT: i am on lecture 20 now, used GraphQLObjectType and bootstrap (this saved me a lot of time as in the later parts max uses a lot of css). i dont regret either of my decisions till now!!
Today i was trying to run same code written in video... So i faced one issue that resolve by updating this code const { graphqlHTTP } = require('express-graphql'); I am sharing this with intention to help other who got same issue.
Happy to read that you like the series Vinay, thank you! I'm still recording the videos so I cannot say how many it will be in the end, but it's definitely a longer series.
When i type graphql into my localhost url i get this error message {"errors":[{"message":"Must provide query string."}]} how do i fix this error please.
Thanks for great tutorials, ur time, energy & knowledge you share with the developer's that follows you. You help us to become much better developer's & to be more valuable on the Stock and not to forget have fun.
Hi, can you pls let us know how this setup maybe done in the case of apollo boost usage. I currently started writing an app with react and redux. But now thinking it would be way better to use graphql and now Im finding the apollo boost, client server, everything can be setup using that. Can you pls make a short video explaining the concepts in that?
Hi Max, first I wanted to thank you for what you do. Second, I have a problem following this video #3 on 5:32, it gives me a type error in the console, saying that graphqlHttp is not a function! I followed everything as you did. do you know what possibly can be the reason? Thanks
Kudos for you for the great job Max! . One question: we're using template literals to definine schemas as for now but this appoach feels somehow odd to me as you cannot take advantage of any intellisense prompts VSCode could give you. So is there a way you can use alternative approach (e.g define Source instead of String or maybe you can recommend any other methods graphql exposes instead of {buildSchema} )?
I don't know what I did wrong but when I'm testing the graphiql in the browser and press ctrl+space nothing happens, there is no dropdown showing. And there is this error message "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data\' Anyway, it is not working at all
When running a Graphiql query I am getting this error: "Cannot read properties of null ('_doc')". Example query: "query { events { title creator { email } } }" It appears to be an error with "creator", becasue it happens when I try to get anything returned from "creator", not just "email". I pulled most recent code from yoru Github repo: yt-graphql-react-event-booking-api. Started with #7, but also having error in #8 as well
At 7:24 you mention you are doing destructuring. That is not correct. It is named imports. You are not pulling properties out of an object but merely pulling out selected exported functions/objects from the file/module specified
If someone is getting this error " graphqlHttp is not a function", Change this line "const graphqlHttp = require('express-graphql');" to this line "const { graphqlHTTP } = require('express-graphql');" Here is the documentation www.npmjs.com/package/express-graphql
@Academind Hey, you have online course where you are teaching how to build restful api in udemy.com but i see you have also videos about Creating a REST API with Node.js here on youtube, so what is the difference ? you have full videoof Creating a REST API with Node.js on youtube for free, why one should pay for that on udemy ?
The free series on TH-cam has a different focus than the more than 30h course on Udemy. On TH-cam we learn how to build a REST Api, in the course you learn Node.js from scratch, which also includes building a REST Api but also a lot of other topics as you can see in the curriculum: www.udemy.com/nodejs-the-complete-guide/?couponCode=AM_NDE
Academind ok thats good, when your building restful api’s in the course do you also build front end for it and connect it all together like full stack ?
We actually do offer a lot of free content (also on Node) on the channel. Creating a 30h+ course is a lot of work though and I assume you also want to get paid for your work, right?
@academind i have getting this error does not getting the proper solution as i have just installed the latest version of node.js in my machione Unexpected token =>
hey max, just wanted to point out you are pronouncing "series" incorrectly, Unfortunately the series have already been recorded so there's no going back, but if no one corrects you, that's bad on us. Here's the correct pronunciation here: en.wiktionary.org/wiki/series#Pronunciation. Thanks for the tutorial!
Thanks a lot for the hint Govind. To be honest I rather focus on the actual content than on the pronunciation of single words, but I'll try to keep it in mind for future videos.
for everyone getting this error: "graphqlHttp is not a function" the import has to be: const { graphqlHTTP } = require('express-graphql');
Look at this issue in stackoverflow stackoverflow.com/questions/62760975/graphqlhttp-is-not-a-function
I solved it by uninstalling express-graphql and installing express-graphql@0.9.0
:< still says it isnt a function
thanks
appreciated man
const { graphqlHTTP } = require('express-graphql');
Always a series with deep core principles and explanations...Keep it up Max!
Every word you say carries a meaning, it's very precise and logical. Wonderful. I keep having to rewatch your videos to fully understand your knowledge.
It's so great to read such a fantastic feedback, thank you very much for your comment!
Max always coming through with very good tutorials. You are a big part of my career.
Prior to v0.10.0, you could use
var graphqlHTTP = require('express-graphql');
After v0.10.0, you need to use
var { graphqlHTTP } = require('express-graphql');
Thanks a lot brother!!😃 I was confused why its not working!!
You're the best teacher I have found after Traversy Media
Thanks a lot for your awesome feedback Kamesh!
great job like always! regards to best teacher of the world
Thank you very very much for your nice feedback Randy!
Agree
I'll forever be grateful from the knowledge i've learnt from you Max from all your youtube videos and udemy courses
Amazing tutorial! Great job, the way you teach is so smooth and interesting that keep us motivated. Thanks!
Great to read that you like it Gabriel, thank you!
Thank you Max for nice start to understanding GraphQL!
Thank YOU for your comment Sasha!
If someone gets an error saying graphqlHttp is not a function replace this line
const graphqlHttp = require('express-graphql'); with
const graphqlHttp = require('express-graphql').graphqlHTTP;
do u know why this is? (this did work thank u)
Thanks!
thanks dilum liyanage
, do u know why is this error ?
@@marcellosanagustin670 'graphqlHttp' needs to be destructured, so you could also import it this way:
const { graphqlHttp } = require('express-graphql');
basicly, it's not exported from the node module by default ;D
Sorry, that should be:
const { graphqlHTTP } = require('express-graphql');
a slight copy paste oversight from my part
to best teacher of the youtube channel . And i have easy to understand your all videos.
Thanks so much for this fantastic feedback, it really makes me happy to read that you like my videos!
@Academind the express-graphql is deprecated now , what package is better and which also has the graphql-ui
the best teacher of the world, thanks
const { graphqlHTTP } = require('express-graphql');
Got to extract it from the import now by the looks.
Thanks, I got the error solved now. Maybe it has changed since 7th July 2020 as stated in npm docs here www.npmjs.com/package/express-graphql
Thanks for help.
If you guys are getting the graphqlHttp is not a function, leave the import as: const graphqlHttp = require('express-graphql');
however, change the app.use from app.use("/graphql", graphqlHttp({ TO app.use("/graphql", graphqlHttp.graphqlHTTP({
Thanks for this tip. Was driving me nuts. Could not figure out what the problem was.
instead of doing like this, destructure it directly in es6 import { graphqlHTTP } from "express-graphql"; and in old const { graphqlHTTP } = require('express-graphql')
Why using schema string over native Grapgql objects like GraphqlObjectType?
Pros and cons?
Hey Max are you going to touch Apollo Server and Graphql-yoga which is a complete package?
Max you're awesome! Your Udemy and TH-cam courses are all incredibly easy to follow and you make learning any new technology exciting and fun.
I have two questions:
1). I'm visiting Munich in August, do you recommend anywhere to check out while I'm there?
2). Do you ever give talks around Europe? I would love to see you if you ever came to the UK.
Thanks again for the great content!
Thanks a million for this awesome feedback, it really makes me happy to read that you like what I'm doing :)
1.) Definitely visit some beer gardens (Hirschgarten for example), the English Garden and if you got a car some of the seas around Munich in summer
2.) At the moment no, I also got no plans to do so in the near future, but we'll see
{
"errors": [
{
"message": "Must provide query string."
}
]
}
I got a message like this in GraphiQL......help me out please
I'm sorry people are heckling you over your pronunciation bro, tbh you're perfectly understandable all throughout the series. Don't pay it any mind.
Hi Max! So I learnt defining my GraphQL schema (query, mutation and resolvers as GraphQLObjectType) with a GraphQLSchema object which seemed more JavaScript friendly than a template literal. Is it any different than the way you implemented it in this video? 🤔
ofc im late but any reason?
EDIT: i am on lecture 20 now, used GraphQLObjectType and bootstrap (this saved me a lot of time as in the later parts max uses a lot of css).
i dont regret either of my decisions till now!!
@@shameekagarwal4872 I can't remember 😂
Today i was trying to run same code written in video... So i faced one issue that resolve by updating this code
const { graphqlHTTP } = require('express-graphql');
I am sharing this with intention to help other who got same issue.
Thanks a lot brother!!😃 I was confused why its not working!!
Hi Max, Thanks for GraphQL Series. Your all series are great to learn new things.
Could you tell me how many lectures remaining in this series?
Happy to read that you like the series Vinay, thank you! I'm still recording the videos so I cannot say how many it will be in the end, but it's definitely a longer series.
@@academind Okay, again thanks for GraphQL Series. :-)
When i type graphql into my localhost url i get this error message
{"errors":[{"message":"Must provide query string."}]}
how do i fix this error please.
Thanks for great tutorials, ur time, energy & knowledge you share with the developer's that follows you.
You help us to become much better developer's & to be more valuable on the Stock and not to forget have fun.
Thank you very much Djordje, it really makes me happy to get such a wonderful feedback :)
thanks for the serie! very useful
can you upload more
Thank you Jafet. Yes, the next videos will be released next week.
the curly brackets needed on line 3:
const { graphqlHTTP } = require('express-graphql');
is express-graphQL required if i am using microprofile GraphQL java package
Can we use 'Postman' instead of 'Graphiql' for testing queries?
Nope it already has its own graphql playground
Hi Max, thank you for this part too.
Could you put this video in to your "Build a Project with GraphQL..." playlist?
Thanks :)
Thanks a lot for the hint Balazs, I added the video.
Can we write 'app.post()' instead of 'app.use()' for handling GraphQL endpoint? We do send a post request though.
Hi, can you pls let us know how this setup maybe done in the case of apollo boost usage. I currently started writing an app with react and redux. But now thinking it would be way better to use graphql and now Im finding the apollo boost, client server, everything can be setup using that. Can you pls make a short video explaining the concepts in that?
excellent video ! congrats for the clear explanation
Your videos are really great and informative! Keep it up!
Awesome to read that Henry, thank you!
I like this 'Romantic cooking'. :)
Hi Max, first I wanted to thank you for what you do. Second, I have a problem following this video #3 on 5:32, it gives me a type error in the console, saying that graphqlHttp is not a function! I followed everything as you did. do you know what possibly can be the reason? Thanks
try this:
const {graphqlHTTP} = require('express-graphql');
Kudos for you for the great job Max! . One question: we're using template literals to definine schemas as for now but this appoach feels somehow odd to me as you cannot take advantage of any intellisense prompts VSCode could give you. So is there a way you can use alternative approach (e.g define Source instead of String or maybe you can recommend any other methods graphql exposes instead of {buildSchema} )?
very thank teacher for this playlist video
Thank you for this !!!, Waiting on #4 🤓🤓
Happy to read that you like it Kamau, #4 will be released tomorrow :)
I don't know what I did wrong but when I'm testing the graphiql in the browser and press ctrl+space nothing happens, there is no dropdown showing.
And there is this error message "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data\'
Anyway, it is not working at all
make sure you have "app.use('/graphql', ..." and not "app.get"
i get this error: ReferenceError: graphqlHttp is not defined .
it is defined at the top as: const graphiql = require('express-graphql');
needs to be
const {graphqlHTTP} = require('express-graphql')
ERROR PROBLEM SOLVED:
const graphqlHttp = require('express-graphql').graphqlHTTP;
When running a Graphiql query I am getting this error: "Cannot read properties of null ('_doc')". Example query: "query { events { title creator { email } } }" It appears to be an error with "creator", becasue it happens when I try to get anything returned from "creator", not just "email". I pulled most recent code from yoru Github repo: yt-graphql-react-event-booking-api. Started with #7, but also having error in #8 as well
We want more! We want more!! :))
More to come next week, no worries Nikola ;)
"graphqlHttp is not a function getting the same error even after trying multiple things
My Teacher on udemy, I have bought 2 course of yours,
Thanks for sharing this
Thanks a lot for your support here and on Udemy Charles :)
@@academind Yeah got hired on my current job , after watching your videos in udemy,
Keep it up man and hoping to see you.
God bless
will be about GraphQL Subscriptions video?
NOW I hit the point .. thanks MAN
At 7:24 you mention you are doing destructuring. That is not correct. It is named imports. You are not pulling properties out of an object but merely pulling out selected exported functions/objects from the file/module specified
Great job Max!
Thank you! Angular universal or next.js course plz.
Why include password in the graphql schema, we never want to return it to the user for any reason and then you don't have to handle it in code
Love your tutorials! Thank you!!!
Great to read that Kenneth, thank YOU for your comment!
truly amazing
Thank you man awesome guide!
the debugging is really really hard work with graphQl :/
If someone is getting this error " graphqlHttp is not a function", Change this line "const graphqlHttp = require('express-graphql');" to this line "const { graphqlHTTP } = require('express-graphql');"
Here is the documentation www.npmjs.com/package/express-graphql
Thanks, It helps.
Wonderful man
Thank you so much 😀
@Academind
Hey, you have online course where you are teaching how to build restful api in udemy.com but i see you have also videos about Creating a REST API with Node.js here on youtube, so what is the difference ? you have full videoof Creating a REST API with Node.js on youtube for free, why one should pay for that on udemy ?
The free series on TH-cam has a different focus than the more than 30h course on Udemy. On TH-cam we learn how to build a REST Api, in the course you learn Node.js from scratch, which also includes building a REST Api but also a lot of other topics as you can see in the curriculum: www.udemy.com/nodejs-the-complete-guide/?couponCode=AM_NDE
Academind ok thats good, when your building restful api’s in the course do you also build front end for it and connect it all together like full stack ?
Do you ever stop Max?
I hope this is just a joke! 🤔
@@stannone7272 you bet it is! ;)
At the moment we don't have plans to stop, no worries ;)
Academind and here it is our boy for the day
THANK U AGAIN MAX!!!!!!!!!!!!!!
Please max describe subscription and real time in graphql
Sir I don't know why you put the complete node js course video free in TH-cam?
We actually do offer a lot of free content (also on Node) on the channel. Creating a 30h+ course is a lot of work though and I assume you also want to get paid for your work, right?
@@academind I understand.i believe you not put 30h+ course on TH-cam.
can you make course about NativeScript please?
Definitely an interesting topic, I don't plan to create such a course in the near future though, sorry.
const { graphqlHTTP } = require('express-graphql');
How can anybody unlike any of your videos? world full of crazy people
Hard to make everybody happy I guess (especially in the anonymous internet). But I'm very thankful for the support I get from you and many others :)
nice keep doing it great! :D
hello max you can create udamy course typescript full stack node react rest api project
Thanks Max!!
Same code result using typegraphql and typeorm - github.com/reactivicky/eventbooking-typegraphql/tree/schemas-resolvers
Welcome to Sirius Black.
@academind i have getting this error does not getting the proper solution as i have just installed the latest version of node.js in my machione
Unexpected token =>
Great Fortunaltelly you use VSCode. I know only that editor :). I am watching all your adds lolz
Thank u for this awesome video and series, will u add for funtionality like image upload, like, comment, reply, interested or not, user profile,
Sir my 2019 goal is complete your node js course and your react native course and make the android app and web app
Did you achieve that? ...just curious :)
TypeError: graphqlHTTP is not a function
Bodyparser is deprecated
Unexpected token < in JSON at position 0
after hitting url
Do not use app.get("/graphql")... but app.use("/graphql")...
@@miodragvujkovic Thanks man, I did the same mistake.
Anyone who has finished the project can give me a github link ?
Great!
Thanks Seth Rogen! :)
:D
buen trabajas
God i love you!
express-graphql is depreciated and no longer maintained.
Finally clicked!
A TIP: Do not name your package graphql while doing npm init the npm will not install the graphql package
hey max, just wanted to point out you are pronouncing "series" incorrectly, Unfortunately the series have already been recorded so there's no going back, but if no one corrects you, that's bad on us. Here's the correct pronunciation here: en.wiktionary.org/wiki/series#Pronunciation. Thanks for the tutorial!
Thanks a lot for the hint Govind. To be honest I rather focus on the actual content than on the pronunciation of single words, but I'll try to keep it in mind for future videos.
@@academind I agree, and the content is excellent!
I love you
:D