WIP Resolve GraphQL introspection issue (#69) via schema merging #255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Okay, here's a draft Pull Request description based on the contributing guide and your git log. Adapt it as needed.
Title: fix: Resolve GraphQL introspection issue (#69) via build-time schema merging
Description:
Problem:
Resolves #69. The previous method of registering GraphQL schemas from different modules solely at runtime (app.RegisterGraphSchema) prevented standard GraphQL introspection tools (like Postman, Insomnia, etc.) from obtaining the complete API schema. This significantly hindered frontend development and testing workflows, as developers couldn't easily explore the available types, queries, and mutations or use features like auto-completion.
Solution:
This PR introduces a hybrid approach using build-time schema merging to enable correct introspection:
Primary Benefit:
While introspection is fixed, the server currently still uses the module-specific schemas loaded via app.RegisterGraphSchema at runtime for actual query execution (this maintains the existing execution path).
Because of this hybrid setup and the use of a simple concatenation script:
This comment/uncomment process is necessary with the current approach. Please refer to the CONTRIBUTING.md guide (added in commit 8023547) for detailed steps on how to add or modify GraphQL fields under this new workflow.