Skip to content

Enforce operation type restrictions in the HTTP and SSE transports #1507

Description

@bclozel

This is a follow-up to #1506, which introduced the mechanism for restricting which GraphQL operation types a request may execute.

This issue is about using that mechanism in the existing transports:

  • GraphQlHttpHandler (WebMvc/WebFlux) only supports query/mutation.
  • GraphQlSseHandler (WebMvc/WebFlux) only supports subscription.

This is a prerequisite for #1450 and #1505, which will further restrict operations based on HTTP method (GET/QUERY must exclude mutations).

This changes existing behavior; a subscription sent to GraphQlHttpHandler over POST currently fails when the transport tries to serialize a Publisher as JSON; it will instead be rejected up front with a proper GraphQL error.

Metadata

Metadata

Assignees

Labels

in: webIssues related to web handlingtype: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions