Skip to content

fix(symfony): api_platform_iris route loader for graphql-only setups#7934

Merged
soyuka merged 1 commit intoapi-platform:4.3from
soyuka:fix/7915
Apr 29, 2026
Merged

fix(symfony): api_platform_iris route loader for graphql-only setups#7934
soyuka merged 1 commit intoapi-platform:4.3from
soyuka:fix/7915

Conversation

@soyuka
Copy link
Copy Markdown
Member

@soyuka soyuka commented Apr 28, 2026

Q A
Branch? 4.3
Tickets #7915
License MIT
Doc PR

Adds a new api_platform_iris Symfony route loader type that registers only the auto-generated NotExposed operations — no exposed REST controllers, no docs/entrypoint routes. This lets users run a GraphQL-only API while keeping IRIs (Relay global IDs, subscription keys, nested IRI inputs) working through the standard api_platform.symfony.iri_converter.

Usage

# config/routes/api_platform.yaml
api_platform_iris:
    resource: .
    type: api_platform_iris

api_platform_graphql:
    resource: '@ApiPlatformBundle/Resources/config/routing/graphql/graphql.php'

REST setups keep type: api_platform exactly as before.

Why this approach

The NotExposedOperationResourceMetadataCollectionFactory already auto-generates a NotExposed operation for any resource without an item GET (for example resources declared with operations: [] and graphqlOperations: [...]). The new loader simply walks the same metadata and emits Symfony routes for those NotExposed operations only. This means IRI generation and matching go through the regular api_platform.symfony.iri_converter — no decorator, no shadow URI-template engine.

@soyuka soyuka force-pushed the fix/7915 branch 3 times, most recently from c3d0b27 to 66e8b01 Compare April 29, 2026 08:11
@soyuka soyuka changed the title feat(graphql): dedicated IRI converter for graphql-only setups feat(symfony): api_platform_iris route loader for graphql-only setups Apr 29, 2026
| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Tickets       | api-platform#7915
| License       | MIT
| Doc PR        | ∅

Adds a new `api_platform_iris` Symfony route loader type that registers
only the auto-generated `NotExposed` operations, allowing graphql-only
APIs to keep IRIs working without exposing REST endpoints. Replaces the
earlier IriConverter decorator approach.
@soyuka soyuka mentioned this pull request Apr 29, 2026
@soyuka soyuka changed the title feat(symfony): api_platform_iris route loader for graphql-only setups fix(symfony): api_platform_iris route loader for graphql-only setups Apr 29, 2026
@soyuka soyuka merged commit 98112ea into api-platform:4.3 Apr 29, 2026
119 checks passed
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