System Information
- Strapi Version: v3.4.4
- Operating System: Windows
- Database: MongoDB
- Node Version: 14.15.1
- NPM Version:
- Yarn Version:
Hi,
I’m not sure if this is expected behaviour or i’m setting up my queries wrong but I have the following collections:
-
Static Pages (has a dynamic zone called PageContent)
-
Sites (a site has a relation to many offers)
-
Offers (an offer belongs to only one site)
I then have a custom component which has two string properties and then a repeatable component of site relations.
all data for all collections is in DRAFT state.
when i use the following query in the graphql playground
query($pageID:String!,$publicationState:PublicationState!){
staticPages(publicationState:$publicationState,where:{PageID:$pageID}){
Title,
Heading,
HeadingImage{
url,
alternativeText
},
PageContent{
… on ComponentStaticComponentsSitesList{
__typename,
Heading,
Description,
Sites{
site{
Name,
Slug,
Logo{
url,
alternativeText
},
Rating,
offers{
Title,
OfferLink
}
}
}
}
}
}
}
with these query parameters
{
“publicationState”: “PREVIEW”,
“pageID”: “Home”
}
everything populates except the offers array, it just returns empty, however if i PUBLISH the items in Offers and Sites (Static Pages can be left in DRAFT), everything populates as i would expect.
Is this the normal behaviour? Is there a way to get the offers relation to populate when in DRAFT state?
I feel like the publicationState must not be passing into the sub selections hence why it returns empty.