gatsby-source-storyblok
gatsby-source-storyblok copied to clipboard
field_[fieldname]_string disappears from graphql when resolving relation
Describe the issue you're facing
This is probably more a question than a bug report, but you don't have a matching template for that, so I'll just go ahead here - sorry.
I have a content called news
. Within this I have a field referencing a category. When inspecting it with graphql explorer I can see the ID of the referenced category by requesting the field field_category_string
:
query {
allStoryblokEntry(
filter: {
field_component: { eq: "news" }
}
) {
edges {
node {
name
uuid
field_category_string
}
}
}
}
Now, if I ask gatsby-source-storyblok
to resolve this relation:
...
{
resolve: 'gatsby-source-storyblok',
options: {
resolveRelations: [
'news.category',
],
},
...
the relation gets resolved as expected but the field_category_string
disappears as an option from graphql. This is very unfortunate since I need the category to query for news withing this category.
Or to re-phrase the question: How can I resolve relations and allow the entities to be filtered by such a resolved relation?
Reproduction
sorry...
Steps to reproduce
No response
System Info
System:
OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
Memory: 13.34 GB / 46.97 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v20.9.0/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
Browsers:
Brave Browser: 121.1.62.156
Chrome: 121.0.6167.139
npmPackages:
gatsby: ^5.12.4 => 5.12.11
Used Package Manager
yarn
Error logs (Optional)
No response
Validations
- [X] Follow our Code of Conduct
Shouldn't you just be able to get that information from the resolved relation then instead?
Thank you! Could you maybe provide an example of how I would filter the entities based on the values of a resolved entity?