feat: add schema_paths for loading schema from local paths and installed packages AR-3#439
Merged
Merged
Conversation
|
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 |
DamianCzajkowski
approved these changes
Jun 30, 2026
Kwaidan00
reviewed
Jul 1, 2026
…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
cee0b53 to
79de200
Compare
Kwaidan00
reviewed
Jul 2, 2026
- schema.py: get_graphql_schema_from_path now delegates to get_graphql_schema_from_paths([schema_path]) so both entry points share one resolve -> read -> build flow (schema_path existence is already validated in BaseSettings.__post_init__, so the import-resolution branch is never reached) - docs / README: describe schema_paths entries with "must be one of ..." and drop the redundant note about unresolvable import paths raising an error - tests: consolidate local file+dir cases into one, merge the dotted-name file/dir cases, place the variable->file test next to variable->directory, group all "raises InvalidConfiguration" cases into one block, and drop the redundant existing-file-skips-importlib test
Kwaidan00
reviewed
Jul 7, 2026
Kwaidan00
approved these changes
Jul 8, 2026
DamianCzajkowski
approved these changes
Jul 8, 2026
amin-farjadi
pushed a commit
to amin-farjadi/ariadne-codegen
that referenced
this pull request
Jul 10, 2026
* origin/main: feat: Allow to use custom client for fetching remote schema [AR-2] (mirumee#444) feat: add schema_paths for loading schema from local paths and installed packages AR-3 (mirumee#439) feat: Allow to use non-httpx HTTP clients in default clients [AR-1] (mirumee#440) remove: unnecessary lines fix fix: tests fix: use explicit UTF-8 encoding for ruff format subprocess (mirumee#422) (mirumee#428) fix: wrap long lines to satisfy ruff E501 docs: document multipart_uploads setting in README and configuration guide feat: add multipart_uploads setting to disable file upload support # Conflicts: # ariadne_codegen/client_generators/package.py
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