graphql / vscode-graphql

MIGRATED: VSCode GraphQL extension (autocompletion, go-to definition, syntax highlighting)
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql
MIT License
555 stars 71 forks source link

Execute Query: Network error: GraphQL Error for HTTP 200 #81

Closed lanwin closed 4 years ago

lanwin commented 6 years ago

When I execute any query like the one below in VSCode, the query is correctly executed, it always prepends "Error: Network error: GraphQL Error:"

image

We use this GraphQL-Dotnet API since 2 years without any problem. From JS with lokka and graphql-request.

So I have no idea where that Network error comes from.

Expected Behavior

When Executing a query I would expect to so only

{
  "data": {
    "version": "0.1"
  },
  "status": 200
}

Actual Behavior

But what I get is

Error: Network error: GraphQL Error: {
  "data": {
    "version": "0.1"
  },
  "status": 200
}

Steps to Reproduce the Problem Or Description

Sadly I have no idea how I can provide such in my case.

Specifications

Logs Of TS Server || GraphQL Language Service

It only prints "NetworkHelper: operation: query"

marktani commented 6 years ago

Just out of curiosity, could you try to have your server return

{
  "data": {
    "version": "0.1"
  }
}

instead? (no extra status property).

Is the network error still printed in this case?

lanwin commented 6 years ago

Well the interesting point is that this property does not come from our api. Ive checked that, but our graphql server only returns the data prop.

acao commented 4 years ago

it could be that your server is configured to respond to invalid graphql queries with a 200 rather than a 403. there was a bug with rendering non-200 requests, now all request responses are rendered in the execution results pane!