-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: highIf it breaks the basic use of the productIf it breaks the basic use of the productsource: plugin:graphqlSource is plugin/graphql packageSource is plugin/graphql packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more informationversion: 5Issue is present in Strapi 5Issue is present in Strapi 5
Description
Bug Report
We use GraphQL in our Next.js application along with codegen to generate types based on the GraphQL schema and queries. In Strapi v5, we have a collection type where localization is disabled, but in the GraphQL schema, the localizations field is still marked as required.
When I include the localizations field in my query, it triggers the same error on the subsequent localizations field (possibly due to a circular dependency).
System Information
- Node.js version: 18.20.4
- NPM version: 10.7.0
- Strapi version: 5.0.0
- Database: MySQL
- Operating System: macOS (darwin-arm64)
- Project Language: TypeScript
Steps to Reproduce
- Enable the GraphQL plugin in Strapi v5.
- Create a collection type with localization disabled.
While the following steps might not be necessary to trigger the issue, they reflect our specific setup:
- Create a component that uses the collection type as a relation.
- Add this component to a Dynamic Zone.
- Create a GraphQL query that queries the component in the dynamic zone
- Run codegen in Next.js to generate
types.ts. - Use the generated type in your application and build the Next.js project.
- You will encounter an error stating that
localizationsis required, despite being disabled.
Expected Behavior
When localization is disabled, the localizations field should not be required in the query.
Screenshots
In the screenshot below, the localizations field is marked as required, even though it is disabled for blogs:
rickklaasboer
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: highIf it breaks the basic use of the productIf it breaks the basic use of the productsource: plugin:graphqlSource is plugin/graphql packageSource is plugin/graphql packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more informationversion: 5Issue is present in Strapi 5Issue is present in Strapi 5
Type
Projects
Status
Fixed/Shipped
Status
Done
