question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Context creation failed - graphql

See original GitHub issue

Hello, can you tell me

Have request: `@authToken = {eyJraWQiOiIwN1Zj}

POST http://localhost:5000/graphql Authorization: {{authToken}} X-REQUEST-TYPE: GraphQL

query listProducts{ fakturaAssist{ listProducts{ id name productNumber } } }`

Getting an error: `HTTP/1.1 500 Internal Server Error content-type: application/json; charset=utf-8 access-control-allow-credentials: true vary: origin access-control-expose-headers: WWW-Authenticate,Server-Authorization cache-control: no-cache content-length: 222 Date: Fri, 13 Mar 2020 12:20:48 GMT Connection: close

{ “errors”: [ { “message”: “Context creation failed: Cannot destructure property payload of ‘undefined’ or ‘null’… Request id: offline_awsRequestId_ck7q5gknc01d24oy29fet2gsi”, “extensions”: { “code”: “INTERNAL_SERVER_ERROR” } } ] }`

if a send request: `POST http://localhost:5000/graphql Content-Type: application/json; charset=utf-8 Authorization: {{authToken}}

query listProducts{ fakturaAssist{ listProducts{ id name productNumber } } }`

Have answer: HTTP/1.1 200 OK content-type: application/json; charset=utf-8 vary: origin access-control-allow-credentials: true access-control-expose-headers: WWW-Authenticate,Server-Authorization cache-control: no-cache content-length: 0 Date: Fri, 13 Mar 2020 12:22:09 GMT Connection: close

and warning: The content type of response is application/json, while response body is not a valid json string

how can I get a response from a request for graphql?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
zAndrey95commented, Mar 19, 2020

@Huachao You are a great person and super support for the project! Good luck! It worked, thanks!)

0reactions
Huachaocommented, Mar 19, 2020

@zAndrey95 I mean maybe you should remove the { and } in the file variable value. You can check the two screenshots you provided, the worked version without { and }, the not-working one has

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication - Context creation failed: · Issue #3600 - GitHub
As i am developing a gql server backend using Apollo server (v2.4.8), i am in need to implement authentication for my gql endpoints....
Read more >
Context Creation Failed during Signin with React & Apollo
[GraphQL error]: Message: Context creation failed: Your session has ended. Please sign in again, Location: undefined, Path: undefined.
Read more >
How to handle errors that are from "context creation" ? : r/graphql
So my token has expired. And within the context I check the "token" from HTTP Header and throw an error when it's not...
Read more >
Context and contextValue - Apollo GraphQL Docs
The context function. Apollo Server 4 changes the syntax for defining a context function. ... a message starting with "Context creation failed: "....
Read more >
Errors - The GraphQL Guide
[JsonWebTokenError: Context creation failed: jwt malformed] message: 'Context creation failed: jwt malformed', locations: undefined, path: undefined, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found