You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
I’m having an issue and not sure if it’s my understanding of Strapi/GraphQL or an issue.
Context: For my use case, I want to show a portfolio of projects (or 'cases'). Each case has a group of contributors that worked on it. This field is separate to the author. The issue is that for technical reasons, a Case's contents is split into two types: draft and published. Which means when I want to get all articles, I need to go one level 'deeper' in the nesting to also include the array of contributors.
Case
-- Draft
---- Caseinfo
------ Contributors
-- Published
---- CaseInfo
------ Contributors
Currently I can get allStrapiCase and get the contents of each case, plus its contributors:
// Used in Gatsby's `<StaticQuery />`// This works fine.allStrapiCase{edges{node{contributors{name}}}}
But when I try to include the nesting
allStrapiCase(filter: {status: {eq: "published"}}){edges{node{published_contents{idtitle// Cannot query field "contributors" on type "StrapiCasePublished_contents".contributors{name}}}}}
So as soon as the contributors field is nested one level deeper, I cannot query it? Conceptually, can you make a deeply nested GraphQL query like this and expect it to follow all relational content types “down the tree”?
The text was updated successfully, but these errors were encountered:
Hi @lucastobrazil , I'm not sure I understand this query:
allStrapiCase(filter: {status: {eq: "published"}}) {
edges {
node {
published_contents {
id
title
// Cannot query field "contributors" on type "StrapiCasePublished_contents".
contributors {
name
}
}
}
}
}
Since you are filtering by status eq: published I would expect the query to return only cases with field status set to "published", for example:
And if you wanted to query draft cases you could just do filter: {status: {eq: "draft"}}
Love this starter, thank you for providing it! ❤️
I’m having an issue and not sure if it’s my understanding of Strapi/GraphQL or an issue.
Context: For my use case, I want to show a portfolio of projects (or 'cases'). Each case has a group of
contributors
that worked on it. This field is separate to theauthor
. The issue is that for technical reasons, aCase
's contents is split into two types:draft
andpublished
. Which means when I want to get all articles, I need to go one level 'deeper' in the nesting to also include the array of contributors.Currently I can get
allStrapiCase
and get the contents of eachcase
, plus its contributors:But when I try to include the nesting
So as soon as the
contributors
field is nested one level deeper, I cannot query it? Conceptually, can you make a deeply nested GraphQL query like this and expect it to follow all relational content types “down the tree”?The text was updated successfully, but these errors were encountered: