Skip to content

fix(metadata): allow GraphQL operations in parameter attributes on properties - #8621

Merged
soyuka merged 1 commit into
api-platform:5.0from
Maxcastel:fix/allow-graphql-operations-for-parameter-attributes-on-properties
Oct 12, 2026
Merged

soyuka merged 1 commit into
api-platform:5.0from
Maxcastel:fix/allow-graphql-operations-for-parameter-attributes-on-properties

Conversation

@Maxcastel

@Maxcastel Maxcastel commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Q A
Branch? 5.0
Tickets Follow-up to #8552
License MIT
Doc PR api-platform/docs#2355

#8552 throws when a parameter attribute on a property is restricted to an operation the resource does not declare, but it only looks at operations: restricting it to a GraphQL operation declared in graphQlOperations always throws:

Before

#[ApiResource(
    operations: [
        new GetCollection(),
    ],
    graphQlOperations: [
        new QueryCollection(),
    ]
)]
class Book
{
    #[QueryParameter(key: 'search', operations: [new QueryCollection()])]
    public string $name = '';
}

RuntimeException: Parameter attribute on property "name" is restricted to the operation "ApiPlatform\Metadata\GraphQl\QueryCollection" which is not declared on the resource "App\Entity\Book".

After

The search parameter is added to the QueryCollection GraphQL operation only (not to the HTTP GetCollection). An operation declared in neither operations nor graphQlOperations still throws.

@Maxcastel Maxcastel changed the title fix(metadata): allow GraphQL operations in parameter attributes on pr… fix(metadata): allow GraphQL operations in parameter attributes on properties Oct 1, 2026
@Maxcastel
Maxcastel force-pushed the fix/allow-graphql-operations-for-parameter-attributes-on-properties branch from f9a7d12 to c3b973a Compare October 12, 2026 09:23
@soyuka
soyuka merged commit ea207ab into api-platform:5.0 Oct 12, 2026
116 of 117 checks passed
@soyuka

soyuka commented Oct 12, 2026

Copy link
Copy Markdown
Member

thanks!

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.

2 participants