GraphQL Endpoint returning null data in certain environments

We are working on getting our Prismic demo up in a QA environment. Everything has been working as expected locally and when hitting the GraphQL endpoint in the browser at https://saatva-blog.prismic.io/graphql.

We are experiencing issues with our QA environment, running in a Docker container on Kubernetes which has internet access. The GraphQL endpoint for getting the individual post content is responding with null on this environment. It responds as expected in the local environment so I am not sure what is going on. All data being passed to the endpoint is the exact same in both environments.

We are using the example Prismic site from Vercel/Next.js. Here is the method in question that makes the API call: next.js/api.js at deprecated-main · vercel/next.js · GitHub

The post property of the query responds with null whereas the morePosts property responds as expected.

Hello, welcome to the Prismic community!

To better understand your use case, lets do some checks:

  • Are you using the Prismic environments feature, or are you talking about an environment that is setup inside your project?

  • Are you making sure the variables are being passed to the query?

  • Could share with me some logs or screenshots of the null response?

Thank you for your response, @Pau! In building out the logs of the working response and the failing response I noticed that our ENV variable for PRISMIC_REPOSITORY_LOCALE was set to "en-us" and my local environment seemed to handle the extra quotation marks fine but the QA environment was treating it differently.

I removed the quotation marks from the ENV variable updating it to just be en-us and that fixed my problem!

Thanks for pointing me in the right direction. I've attached a screenshot of the two different header bodies being sent in the request.

Screen Shot 2020-11-09 at 1.59.00 PM

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.