fix(metadata): reject duplicate GraphQL operation names instead of silently dropping them by Maxcastel · Pull Request #8713 · api-platform/core · GitHub
Skip to content

fix(metadata): reject duplicate GraphQL operation names instead of silently dropping them - #8713

Open
Maxcastel wants to merge 2 commits into
api-platform:5.0from
Maxcastel:fix/graphql-duplicate-operation-names
Open

Maxcastel wants to merge 2 commits into
api-platform:5.0from
Maxcastel:fix/graphql-duplicate-operation-names

Conversation

@Maxcastel

Copy link
Copy Markdown
Contributor
Q A
Branch? 5.0
Tickets Follow-up of #8232
License MIT
Doc PR

GraphQL operations are indexed by name, so a second operation with the same name silently replaced the first one:

#[ApiResource(graphQlOperations: [
    new Query(name: 'item_query', security: 'is_granted("ROLE_ADMIN")'),
    new Query(name: 'item_query'),
])]

Only the query without security was kept. This throws now, like #8232 does for HTTP operations (attributes and YAML/XML).

@Maxcastel Maxcastel changed the title fix(metadata): reject duplicate GraphQL operation names instead of silently them fix(metadata): reject duplicate GraphQL operation names instead of silently dropping them Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant