-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby 3: graphql query during createPages breaks allSitePage:filter: #30107
Comments
I've made some more experiments to see if something with my async handling is wrong.
The filters are present and the console output also looks good in my opinion:
I've done a similar thing with the query:
The log:
The result filter broken. :-( |
Thank you so much for the repro 💜 It should be fixed via #30132. I'll post an update here when the fix is published. |
@vladar |
@ahmadkhalaf1 That's what happens when you run a page query with the broken filters. I would assume that this is the same issue. |
@valdar Thanks for the fast fix. |
Published in |
fixed my issue thanks ^^ |
Description
I am trying to filter my graphql pages using a filter on
allSitePage:filter:context
. Everything was ok in Gatsby2 with my migration to Gatsby3 the filter is now gone from the graphql.The issue only happens when I run a query during
createPages
. I can restore the original data by commenting-out everyawait graphql()
.Steps to reproduce
I've created a minimum project to demonstrate the issue. It's the starter project, the changed interesting file is the gatsby-node.js.
The stripped down content of
createPages
looks like this:Everything is ok from the start:
Visit http://localhost:8000/___graphql
Edit
gatsby-node.js
and uncomment the following lines:Re-start gatsby and visit http://localhost:8000/___graphql
Expected result
allSitePage(filter: {context: {dog: {}}}) should be available in the graphql database.
Everything else seems to be ok in the graphql database... the nodes have the context fields. It's just the filter that is broken.
Actual result
allSitePage(filter: {context: {dog: {}}}) is gone as soon as I run a query during createPages()
Environment
System:
OS: macOS 11.2.2
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.4.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.0.15 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 88.0.4324.192
Firefox: 86.0
Safari: 14.0.3
npmPackages:
gatsby: ^3.0.1 => 3.0.3
gatsby-plugin-image: ^1.0.0 => 1.0.0
gatsby-plugin-manifest: ^3.0.0 => 3.0.0
gatsby-plugin-mdx: ^2.0.0 => 2.0.0
gatsby-plugin-postcss: ^4.0.0 => 4.0.0
gatsby-plugin-react-helmet: ^4.0.0 => 4.0.0
gatsby-plugin-sharp: ^3.0.0 => 3.0.0
gatsby-plugin-sitemap: ^3.0.0 => 3.0.0
gatsby-source-filesystem: ^3.0.0 => 3.0.0
gatsby-transformer-sharp: ^3.0.0 => 3.0.0
The text was updated successfully, but these errors were encountered: