GraphQL Tutorial - Network error: Unexpected end of JSON input

New Member
2 0 2


Im working thru the GraphQL tutorial and am getting a "Unexpected end" error 

Ive tried taking the Master from and same error


Behind the scenes its a 406 error on the graphql POST -

  1. {operationName: "getProducts", variables: {ids: ["gid://shopify/Product/5412690559143"]},…}
    1. operationName: "getProducts"
    2. query: "query getProducts($ids: [ID!]!) {↵ nodes(ids: $ids) {↵ ... on Product {↵ title↵ handle↵ descriptionHtml↵ id↵ images(first: 1) {↵ edges {↵ node {↵ originalSrc↵ altText↵ __typename↵ }↵ __typename↵ }↵ __typename↵ }↵ variants(first: 1) {↵ edges {↵ node {↵ price↵ id↵ __typename↵ }↵ __typename↵ }↵ __typename↵ }↵ __typename↵ }↵ __typename↵ }↵}↵"
    3. variables: {ids: ["gid://shopify/Product/5412690559143"]}


I can run the same request from the Graphiql app and it is successful - now the main difference looks like CORS


Any ideas on this issue?




New Member
2 0 2


The issue was that the tutorial is using a mix of ApiVersions -

Hook - 

apiVersion: ApiVersion.October19

Server - 

server.use(graphQLProxy({ version: ApiVersion.April19 }));

I upgraded to -


And its working - might be worth updating the tutorial with a suggestion to update the graphql version if the master project in github stops working


Shopify Staff
Shopify Staff
90 8 12

Thanks for identifying that @martinglen,

Although the tutorial does already suggest that "In most cases, you'll always want to use the most recent version of the API." in step 5 of, I can see how that might be confusing when specified differently on those two lines in the source.

The server.js file in github has been updated to reflect the most recent July20 version.

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog