Skip to content

[GraphQL] Introduce ArgumentParameter for first-class GraphQL schema argument metadata #7966

@soyuka

Description

@soyuka

Context

src/GraphQl/Type/FieldsBuilder.php builds GraphQL arguments from two parallel sources today:

  1. Legacy Operation::getFilters() (list of string filter ids) → getFilterArgs().
  2. Modern Operation::getParameters() (QueryParameter collection) → getParameterArgs().

Both paths walk FilterInterface::getDescription(), normalize bracketed keys via parse_str, and emit InputObjectType trees — with different output shapes and divergent edge-case handling (see also #7953-adjacent bug around bracketed keys + object-form filters).

Proposal

Introduce an ArgumentParameter (working name) — a metadata-layer concept that marks "this parameter participates in the GraphQL schema" as first-class. FieldsBuilder then has a single source of truth and a single argument-building pass, instead of two divergent paths.

Sketch:

  • A dedicated parameter subtype, or an explicit graphQl: true|ArgumentDescriptor flag on QueryParameter.
  • Operation::getFilters() is normalized into synthetic ArgumentParameters for GraphQL, deprecating the dual code path inside FieldsBuilder.
  • FieldsBuilder only consumes ArgumentParameters.

Scope

  • 4.4 / 5.0 — not a backport-friendly change.
  • Touches metadata factories, schema builder, probably the resource extractors (PHP attribute / XML / YAML), and docs.

Why a note, not a plan

This issue exists so the idea is tracked. Real design happens later; the 4.3 branch only does the surgical bug fix + helper extraction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions