-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR -> "Cannot read property 'get' of undefined" when using post with auth headers #24
Comments
I'm getting the same error with subscriptions. Have you found a fix for it? |
Unfortunately, no. But also, I don't use graphql in my job or projects. |
Ok but thanks for you quick answer. |
Thanks @mmswi for opening this issue 😄. It seems to be solved following the latest docs. Closing this for now, please, feel free to open an issue if you cannot make it work! |
Having the same issue going through the How To GraphQL backend graphql-node tutorial. Here is the repo hackernews-node. Getting error Cannot read property 'get' of undefined from the src/utils.js file. |
Hi @brittneypostma , did you get the solution? |
Mismo error, alguna solución? Estoy usando strapi v4 y al hacer una mutation aparece: Error: GraphQL error: Cannot read property 'get' of undefined Ayuda por favor |
Hello all,
Any ideas why I'm getting this error?
My utils file here: https://github.com/mmswi/graphQL-tut/blob/master/src/utils.js
My mutation here: https://github.com/mmswi/graphQL-tut/blob/master/src/resolvers/Mutation.js
Note, I've hardcoded the user id and used a try catch block, as I got an error in the console that was saying:
(node:16656) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Anyways, same "Cannot read property 'get' of undefined" error received when not using a try catch block.
With the hardcoded id, the post function works, so I'm wondering why is the context get returning that error. The auth headers have been added also in the graphql playground
{ "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjamd5ODg1MXczZGd3MGIwOG91dHE1OWRrIiwiaWF0IjoxNTI1ODkyMjQwfQ.mW-uDhlG3cGJRi14lw2g_YQSVLWS1Xnkw_VzK_QliO0" }
Thanks
The text was updated successfully, but these errors were encountered: