feat: add schema_paths for loading schema from local paths and installed packages AR-3#439
Open
Minister944 wants to merge 2 commits into
Open
feat: add schema_paths for loading schema from local paths and installed packages AR-3#439Minister944 wants to merge 2 commits into
Minister944 wants to merge 2 commits into
Conversation
…led packages Introduce a new `schema_paths` setting that builds the GraphQL schema from multiple sources. Each entry is resolved either as a dotted Python attribute path (e.g. `pkg.SCHEMA_DIR` or `pkg.get_schema_files`) — useful for pulling type definitions from installed packages — or as a local file/directory path. - schema.py: add `resolve_schema_paths` and `get_graphql_schema_from_paths` - main.py: wire `schema_paths` into both `client` and `graphqlschema` strategies - settings.py: add the `schema_paths` field and make the three schema sources (`schema_path`, `schema_paths`, `remote_schema_url`) mutually exclusive — providing more than one now raises InvalidConfiguration; simplify `using_remote_schema` accordingly - docs/README: document `schema_paths` and the mutual-exclusivity rule
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce a new
schema_pathssetting that builds the GraphQL schema frommultiple sources. Each entry is resolved either as a dotted Python attribute
path (e.g.
pkg.SCHEMA_DIRorpkg.get_schema_files) - useful for pullingtype definitions from installed packages - or as a local file/directory path.
resolve_schema_pathsandget_graphql_schema_from_pathsschema_pathsinto bothclientandgraphqlschemastrategiesschema_pathsfield and make the three schema sources(
schema_path,schema_paths,remote_schema_url) mutually exclusive -providing more than one now raises InvalidConfiguration; simplify
using_remote_schemaaccordinglyschema_pathsand the mutual-exclusivity ruleCI/CD does not pass. This is an unrelated error that is being fixed as part of AR-6
Acknowledgements
While working on this, we noticed #431 by @esfomeado, which also tackled
loading the schema from more than one source. After discussing it as a team,
we went with a different approach - a dedicated
schema_pathssetting thatadditionally resolves dotted Python attribute paths from installed packages -
which we felt fit the project better. Thanks @esfomeado for raising the problem
and for your contribution! 🙏
Co-authored-by: esfomeado 1906254+esfomeado@users.noreply.github.com