-
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
GraphQL: don't filters work for children inside the array? #8764
Comments
It's not a bug - filters are only filtering out nodes and not data in nodes. This would need separate filter feature on array types which gatsby currently doesn't support - something like this: query SomeQuery {
allSomeFolderJson {
edges {
node {
SomeRootField(filter: { key: { eq: "category.getting-started" }) {
key
title
url
}
}
}
}
} |
@pieh What about to add support for such filtering? Imagine you have 300 different keys under, and all of that will be fetched and added as a JSON making build of 10k pages weights around 10GB. |
Array filtering would need to be done in gatsby core (if you want to use |
Description
I've been using gatsby-source-filesystem and gatsby-transformer-json plugins to GraphQL the info from JSON files.
I have the structure:
And gatsby-config.js:
The structure of those JSONs:
I expected that after that I will be able to query children fields like:
Steps to reproduce
https://codesandbox.io/s/6j69x4o16k
Expected result
I expected that the response should be like:
Actual result
The actual result of that query:
Is it OK or it's a bug?
The text was updated successfully, but these errors were encountered: