Relational fields are duplicated in GraphQL API responseย #22456
Open
Description
Hello ๐
Bug report
Required System information
- Environment: development / production
- OS: darwin-arm64
- Strapi Version: 5.5.0
- Node/Yarn Version: yarn/3.8.6 npm/? node/v20.11.1 darwin arm64
- Edition: Community
- Database: postgres
- Typescript
Describe the bug
We've migrated from v4 to v5.5 a few days ago.
- When using the GraphQL API, some entries (relational fields) are duplicated (same
documentId
, differentid
) - When using the REST Api, entries are not duplicated.
Steps to reproduce the behavior
- Create a "Speaker" collection and a "Speaker List" single-type.
- Add a relational field in Speaker List = Speaker List has many Speakers
- Create a new Speaker, publish it, add it to the Speaker List single-type, publish the single-type.
- Check the GraphQL playground response with the following query:
query ExampleQuery {
speakerList {
speakers {
documentId
}
}
}
- Observe the duplicated response :
{
"data": {
"speakerList": {
"speakers": [
{
"documentId": "nuxc57xqwt8tr6i9ut9894xw"
},
{
"documentId": "nuxc57xqwt8tr6i9ut9894xw"
}
]
}
}
}
Expected behavior
Response should not be duplicated and have only one document:
{
"data": {
"speakerList": {
"speakers": [
{
"documentId": "nuxc57xqwt8tr6i9ut9894xw"
},
]
}
}
}
Screenshots
Code snippets
If applicable, add code samples to help explain your problem.
Additional context
Dependencies of package.json
:
"dependencies": {
"@strapi/plugin-cloud": "5.5.2",
"@strapi/plugin-graphql": "5.5.2",
"@strapi/plugin-users-permissions": "5.5.2",
"@strapi/provider-email-nodemailer": "5.5.2",
"@strapi/provider-upload-aws-s3": "5.5.2",
"@strapi/strapi": "5.5.2",
"pg": "8.11.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Metadata
Assignees
Labels
Type
Projects
Status
To be reviewed (Open)
Status
Backlog