gatsby: GraphQL Error Unknown field that happens randomly
Description
When I run gatsby develop or build it fails sometimes on the first few runs and then without any code changes running the same command after will build successfully.
For example, today I started the project and had to repeat: gatsby clean && gatsby develop, several times until it starts working. I’m fetching data from a remote GraphQL and not the local or md files, etc. Checked the remote GraphQl and is always fully working (tested with HTTP Post requests sending the query + variables, returns data absolutely fine); then checked the local __graphpql and could not find the remote GraphQL.
Steps to reproduce
It’s random! Here’s a youtube video where I demonstrate the issue ( https://youtu.be/2uniflq5I-Q )
Expected result
I expect to not have to run the command several times to make it work
Actual result
`GraphQL Error Encountered 2 error(s):
Unknown field ‘wpcms’ on type ‘Query’. Source: document`
Environment
System: OS: macOS 10.14 CPU: (4) x64 Intel® Core™ i5-5257U CPU @ 2.70GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node Yarn: yarn install v0.27.5 [1/4] Resolving packages… success Already up-to-date. Done in 1.05s. - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm Languages: Python: 2.7.10 - /usr/bin/python Browsers: Chrome: 73.0.3683.103 Firefox: 66.0.3 Safari: 12.0 npmPackages: gatsby: ^2.3.16 => 2.3.16 gatsby-image: ^2.0.37 => 2.0.37 gatsby-plugin-alias-imports: ^1.0.5 => 1.0.5 gatsby-plugin-eslint: ^2.0.4 => 2.0.4 gatsby-plugin-manifest: ^2.0.28 => 2.0.28 gatsby-plugin-offline: ^2.0.25 => 2.0.25 gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12 gatsby-plugin-sharp: ^2.0.32 => 2.0.32 gatsby-source-filesystem: ^2.0.29 => 2.0.29 gatsby-source-graphql: ^2.0.18 => 2.0.18 gatsby-transformer-sharp: ^2.1.17 => 2.1.17 npmGlobalPackages: gatsby-cli: 2.5.7
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 27 (1 by maintainers)
I’ve been having a similar issue, totally intermittent. Nothing crazy here with our setup, but we are using
gatsby-source-graphqlas well.Today I had to
gatsby clean and developquite a lot of times 'till it started working again. No code changes!@heldrida sorry for the “radio silence”(pardon the bad pun), but do you mind waiting a little longer?
Tomorrow i’ll enumerate what i did and the testing methodology used and my results? Sounds good?