gatsby-plugin-local-search
gatsby-plugin-local-search copied to clipboard
Can't query page context fields of pages created in gatsby-node.js
I'm using gatsby-node.js to create a bunch of pages which I would like to search through using your plugin. I'm passing all the needed data into the pagecontext during the creation of the pages.
My query looks like this:
query: `
{
allSitePage {
edges {
node {
path
context {
id__normalized
market_cap_rank
name
symbol
}
}
}
}
}
`,
The error says: Cannot query field "context" on type "SitePage".
I'm not really sure if this just isn't supported or whether I am overlooking something here. The only thing that I can see that seems fishy to me is that the "success create pages" message in the console comes after the error, which makes me think that the pages don't exist yet when I'm trying to query them.
Any hints would be much appreciated! :)
This is a known thing: https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v3-to-v4/#field-sitepagecontext-is-no-longer-available-in-graphql-queries