Description
Description:
When merging GraphQL schemas registered through app.RegisterGraphSchema()
at runtime, the GraphQL handler works as expected in terms of query/mutation execution. However, schema introspection (e.g., via Postman or other GraphQL clients) does not return expected results for resolvers outside the core
module. Only the core
module's resolvers are introspectable.
Steps to Reproduce:
- Register multiple GraphQL schemas at runtime using
app.RegisterGraphSchema()
:app.RegisterGraphSchema(application.GraphSchema{ Value: graph.NewExecutableSchema(graph.Config{ Resolvers: graph.NewResolver(app), }), BasePath: "/warehouse", })
- Launch the server and use Postman or another GraphQL IDE to send introspection queries.
- Observe that only the
core
module's schema is visible via introspection.
Expected Behavior:
All registered schemas—including those outside the core
module—should be visible and introspectable through standard GraphQL introspection queries.
Actual Behavior:
Only resolvers from the core
module are visible via introspection. Queries and mutations from other registered schemas work, but are hidden from introspection tools.
Possible Solution (Optional):
The issue likely lies in the code responsible for merging schemas at runtime. It may be excluding non-core
resolvers or failing to properly merge the introspection-related parts of the schema.
Environment:
- Library:
gqlgen
(Go) - Tool used for introspection: Postman / GraphQL IDE
- Modules: Multiple GraphQL modules, merged at runtime via
app.RegisterGraphSchema()
Additional Context:
Related discussion: [PR #38 comment](#38 (comment))
The issue is not due to how modules are registered individually—core
is not treated differently. The problem is specific to the schema merging implementation.
Metadata
Metadata
Assignees
Type
Projects
Status