Skip to content

fix(introspection): schema transformation for custom scalar#313

Open
MathisPct wants to merge 1 commit intodeweyjose:mainfrom
MathisPct:fix/schema-transformation-custom-scalars
Open

fix(introspection): schema transformation for custom scalar#313
MathisPct wants to merge 1 commit intodeweyjose:mainfrom
MathisPct:fix/schema-transformation-custom-scalars

Conversation

@MathisPct
Copy link

#312

SchemaTransformationServicerewrites custom root operation names to the standardQuery, Mutation, and Subscription` names before printing the schema back to SDL.

This step currently rebuilds an executable GraphQLSchema from the parsed registry. That works for simple schemas, but it breaks on introspected schemas when they contain custom scalars such as uuid and timestamptz.

With an empty RuntimeWiring, graphql-java cannot build the executable schema and fails before SchemaPrinter gets a chance to print the transformed schema.

What this MR does

This MR replaces the empty runtime wiring with a minimal local wiring dedicated to schema printing:

  • no-op data fetchers
  • no-op type resolvers
  • placeholder scalar implementations for non-standard scalars

This is enough to let graphql-java build a printable schema without relying on RuntimeWiring.MOCKED_WIRING, which is documented as testing-only.

Result

The transformation step now works for introspected schemas with custom scalars, while remaining safe because the generated wiring is only used to print the schema, not to execute it.

Tests

Added a regression test covering a schema with:

  • custom root operation names
  • custom scalars (uuid, timestamptz)
  • input types referencing those scalars

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