api-design-node-v2 icon indicating copy to clipboard operation
api-design-node-v2 copied to clipboard

WIndows issue GraphQLError: Unknown operation named "null".

Open wroughtec opened this issue 7 years ago • 1 comments

Ran into a issue while going through the course on FE masters and initially thought it was me. On Windows when running any of the nested query eg.

{ 
  allPlaylists {
    title
    songs {
      title
    }
  }
}

I would get the following error reported server side when I ran the query first time:

GraphQLError: Unknown operation named "null".
    at buildExecutionContext (pathTo\node_modules\graphql\execution\execute.js:202:13)
    at executeImpl (pathTo\node_modules\graphql\execution\execute.js:121:15)
    at Object.execute (pathTo\node_modules\graphql\execution\execute.js:110:229)
    at doRunQuery (pathTo\node_modules\apollo-server-core\src\runQuery.ts:149:16)
    at pathTo\node_modules\apollo-server-core\src\runQuery.ts:70:39
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

On the browser I would get when I run the query before anything else: image

However if I run a query ie { allPlaylists {title}} first then the nested query it works: image

Notice that to only difference (apart from the error code) is operationName: "null" compared to operationName: null and as long as you don't refresh graphiql all future queries seem to work its just when you try a nest query before a normal query

To check I was not going mad I quickly checked things on my Mac and had no issues so seems to be a Windows thing so this is a heads up if anyone else runs into the issue (the issue is present on lesson-14-solution branch)

Good course by the way learn t a lot

wroughtec avatar Oct 26 '17 09:10 wroughtec

I just got a windows machine 😄 so I'll try to reproduce this, thanks!

Hendrixer avatar Jun 29 '18 19:06 Hendrixer