Skip to content

Replace manual GraphQL layer with generated client#17

Merged
thiagolepidus merged 41 commits into
thoth-pub:mainfrom
lepidus:main
Jun 16, 2026
Merged

Replace manual GraphQL layer with generated client#17
thiagolepidus merged 41 commits into
thoth-pub:mainfrom
lepidus:main

Conversation

@thiagolepidus

Copy link
Copy Markdown
Collaborator

Adds a generated GraphQL client based on the Thoth introspection schema, replacing the previous manually maintained GraphQL model/query/mutation layer.

The generated client exposes typed query, mutation, schema, input, enum and scalar classes, while keeping the dynamic GraphQL\Client API as the main entry point.

Changes

  • Adds composer generate-graphql-client to regenerate GraphQL classes from the current schema.
  • Generates GraphQL schema objects with getters, setters and toArray() support.
  • Generates input classes for mutation arguments, including support for arrays, DTOs with getAllData(), and JsonSerializable values.
  • Generates enum/scalar wrappers and PHPDoc for operation methods and schema accessors.
  • Adds validation for operation arguments, required inputs, variable types, enum values and selected fields.
  • Sends operation arguments as GraphQL variables instead of interpolating values into query strings.
  • Preserves GraphQL response error context and wraps transport/schema loading failures with clearer exceptions.
  • Removes the old generated Models, QueryProvider, mutation builder and client concern classes.

@thiagolepidus thiagolepidus merged commit 31f257d into thoth-pub:main Jun 16, 2026
5 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