Closed SamJamWillingham closed 3 years ago
Have you set up the route you're using? (/api
) Are you using the right token for access or, if not using a token, is the Public Schema configured to allow Gatsby queries?
I have my endpoint set up to /api, and I am using a private schema with the token in my gatsby config.
Okay, next thing to check would be Craft CMS log files - GraphQL API responses are always in JSON, so it's possible that you're hitting a PHP error and there's a stack trace in the response, which should also get logged to the log files.
I'm very new to Craft-- are the log files the same ones that you can reach via the dashboard > utilities > logs ? Or are they stored in the database?
They are stored on the server - storage/logs/
and you would be interested in both phperrors.log
(if it exists) and web.log
.
I went through both phperrors and web and didn't see any trace of my failed API call
That is odd. Are you able to query the API using the same token with a client, for example, Insomnia?
So I'm getting the same error message in Insomnia. I tried reading through the timeline tab but I am struggling to understand enough to find where it went wrong. (I didn't block out or censor anything in the preview window. Its just blank)
Not to get too confusing but this project is migrating an existing create-react-app website to Gatsby. In the first React version, obviously being client side rendering, I used ApolloClient and would get the response below. But now using Gatsby and their source plugin, I'm running into this problem. Hope some context is helpful?
Well, the good news is that it's reproducable from an "external" request. Is this in a publicly reachable site, somewhere? If so, is it possible to share the Gatsby token via email with support@craftcms.com? I could try to unravel this for you then.
If you can do that, please reference this issue. If this is not on a public site, I'll think on some options on how to make it easer to debug this.
Sorry for all the hassle!
Closing due to inactivity.
Description
I am working on a project that is essentially taking an existing templated Craft website and creating new Gatsby front-end. The existing website is not in Headless mode yet while the new front end is still in development.
Does craft have to be in headless mode for these plugins to work? I ask because I'm getting these errors while trying to connect the API to the existing (not headless) CMS and I read in the craft documentation that the API responses are in HTML unless in headless mode where the responses will then be in json.
Steps to reproduce
1. 2.
Additional info