I report this because I assume that gatsby develop and gatsby build should show the same bebavior in that if gatsby develop compiles, gatsby build should as well.
When there is a GraphQL error, gatsby develop will report the error, ignore it and show compiling successfully while gatsby build will fail in compiling because of the error. So, for a small project, I think it is fine. But if the project was big and developers did not notice errors during development, that might be a problem. For example, in my personal website, I introduced some of them during the development and the website showed normally, but it failed during gatsby build.
Related: #3425
gatsby new gatsby-sitesrc/pages/page-2.js:export const query = graphql`
query Query {
error
}
`
gatsby develop and gatsby buildgatsby develop and gatsby build both stop due to the GraphQL error.
gatsby develop continued to compile successfully while gatsby build stoped
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Binaries:
Yarn: 1.5.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.1.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^1.9.247 => 1.9.272
gatsby-link: ^1.6.40 => 1.6.44
gatsby-plugin-react-helmet: ^2.0.10 => 2.0.11
IMO having to re-start gatsby develop after every typo in your graphql queries when developing would be worse DX. That said, having those error show in overlay in browser would defenitely make people notice those (if they would miss those errors) - and we have issue for that https://github.com/gatsbyjs/gatsby/issues/5234
Yeah, we're not going to stop the development server on graphql errors. Doing that makes it hard to solve them as you can't then access graphiql. If you'd like to help solve the issue @pieh linked to that'd be great!
Most helpful comment
Yeah, we're not going to stop the development server on graphql errors. Doing that makes it hard to solve them as you can't then access graphiql. If you'd like to help solve the issue @pieh linked to that'd be great!