Closed mcclaskiem closed 3 years ago
Ended up being an issue with not having the discover types enabled. 🤦
@mcclaskiem I'm running into the same issue, and noticed this in the Readme
Once your endpoint and schema are established, be sure to enable Allow discovery of sourcing data for Gatsby in the Gatsby section of the schema you’d like to query with the gatsby-source-craft Gatsby plugin.
But I'm not really sure how to enable type discovery. I searched the Craft docs and the Gatsby docs (although I'm guessing it's a Craft setting).
How did you enable this?
Need to make sure you have the Gatsby Helper plugin installed and then within the Gatsby Schema section where you check off what is available there should be an option above the mutate section that says allow discovery
@mcclaskiem Thank you! I had completely missed the helper plugin section of the readme 🤦
Description
I just set up a fresh install of Craft and Gatsby. After configuring both the front-end and back end and starting up the server I get the below error:
I checked out the plugin code and it looks like the
createTypes(typeDefs)
is getting an empty string as an argument. I currently have no queries set up in Gatsby so not sure if this is an issue here. Was hoping I could spin it up and use the Graphiql tool to make sure things were set up correctly.Steps to reproduce
gatsby develop
Additional info
For some reason I have never had the routes config setting work on my graphql apis, not sure if it is something that Laravel Forge prevents or not. But I have gatsby pointing at the
/actions/graphql/api
endpoint. Happy to provide any other info as well!