Error 500 about GraphQL request

Topic summary

Error 500 when querying Shopify’s GraphQL API to fetch products; console logs show “Cannot handle token prior to 2022-06-17T16:06:39+0000” with Firebase\JWT\BeforeValidException.

Initial query had syntax issues: missing opening “{” and a typo (“cursoro”). A corrected example was provided with proper braces and the “cursor” field (used for pagination in GraphQL connections).

After adding braces and removing the cursor field, the same JWT error persists. The poster shared a GitHub repository (resources/js/components/ProductPage.jsx) and suspects an authentication/session_token problem.

Key terms: GraphQL (API query language); JWT (JSON Web Token) that includes validity timestamps; BeforeValidException indicates a token used before its “not-before” time.

Current status: No resolution. Syntax corrections did not fix the 500 error, suggesting the issue is unrelated to the query itself. Next steps implied: review auth/session token handling and token timestamps in the provided code. Discussion remains open, with the shared repo central to troubleshooting.

Summarized with AI on February 14. AI used: gpt-5.

Hi,

I’m working on a custom application and i got an error 500 when trying to get product with GraphQL API, the code is from Laravel Shopify sample.

i have log the error in the console and i got a JS error object:

message Cannot handle token prior to 2022-06-17T16:06:39+0000

Exception: Firebase\JWT\BeforeValidException

The query was:

products(first: 10) {
        edges {
            cursoro
            node {
                id,
                title,
                onlineStoreUrl
            }
        }
    }

Thank you for reading

Hey @Ectaclick - thanks for getting in touch. I might have a solution for you, can you try giving the following query a go?

{
    products(first: 10) {
        edges {
            cursor
            node {
                id,
                title,
                onlineStoreUrl
            }
        }
    }

If you’re making a basic root query, you’ll want to double check that you have that “{” on the first line of your query in order to open it. I also noticed there looks like there’s an extra “o” in “cursor”, so that could have potentially caused the issue too. Let us know if this helps or if you encounter any further issues - happy to help when we can.

Take care!

Hi,

I added the brackets and remove the cursor word and i got the same error in JS console, you can see my code if you need:

https://github.com/Ectaclick/ectaclick.myshopify.com-devapp_php

The code is in the file: resources/js/components/ProductPage.jsx

I think it’s a problem with my Auth and my session_token

Thank you for help