Skip to content

Add feign-graphql-apt module#3212

Open
velo wants to merge 1 commit intomasterfrom
feature/graphql-apt-module
Open

Add feign-graphql-apt module#3212
velo wants to merge 1 commit intomasterfrom
feature/graphql-apt-module

Conversation

@velo
Copy link
Member

@velo velo commented Feb 7, 2026

Summary

  • New feign-graphql-apt module: an annotation processor that generates Java types from GraphQL schemas at compile time
  • Given a @GraphqlSchema-annotated interface with @GraphqlQuery methods, the processor validates queries against the schema and generates input/result POJOs, enums, and nested types
  • Supports deeply nested types, list types, enum generation, transitive type resolution, and deduplication of shared input types

Details

  • Annotations: @GraphqlSchema(path) on interface, @GraphqlQuery(query) on methods
  • Validation: Queries are validated against the schema with line/column error reporting via Messager
  • Type mapping: GraphQL scalars → Java types (Int→Integer, Float→Double, ID→String, etc.), [T]→List<T>, enums → Java enums
  • Nested generation: Selection sets produce result types with only selected fields; input types include all schema-defined fields
  • Dependencies: graphql-java 22.4, javapoet 1.13.0, auto-service-annotations, compile-testing (test)
  • Java 17 required (matches apt-test-generator)

Test plan

  • 11 compile-testing tests covering: valid mutation, invalid query error, missing schema error, nested types, enums, list types, shared input deduplication, deeply nested org queries (4+ levels), complex mutation with transitive inputs, search with complex filter inputs, multi-level type reuse
  • mvn clean install -pl graphql-apt -Pdev passes

🤖 Generated with Claude Code

Signed-off-by: Marvin Froeder <velo.br@gmail.com>
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