-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added ability to override federation version on export schema command #3697
base: main
Are you sure you want to change the base?
added ability to override federation version on export schema command #3697
Conversation
Reviewer's Guide by SourceryThis PR adds functionality to override the federation version when exporting a GraphQL schema using the Sequence diagram for export-schema command with federation version overridesequenceDiagram
actor User
participant CLI as CLI
participant App as Application
participant Schema as Schema
User->>CLI: Run export-schema with --federation-version
CLI->>App: Set federation_version_override
App->>Schema: Modify schema directive URL
Schema-->>App: Return modified schema
App-->>CLI: Output schema
CLI-->>User: Display schema with overridden federation version
Updated class diagram for ImportedFrom classclassDiagram
class ImportedFrom {
+String name
+String url
+__init__(**kwargs: Dict[str, Any])
}
note for ImportedFrom "Added logic to override URL based on federation_version_override"
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @iotflowadmin - I've reviewed your changes - here's some feedback:
Overall Comments:
- There are several typos in the documentation and help text that should be fixed: 'backword' -> 'backward', 'useing' -> 'using', 'brake' -> 'break', 'ussage' -> 'usage', 'effect' -> 'affect'
Here's what I looked at during the review
- 🟡 General issues: 5 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Thanks for adding the Here's a preview of the changelog: Added option for the export_schema command to override the output federation version. This change ONLY affects "strawberry export-schema" command and is fully backward-compatible without any logic change. Warning: Please use with caution!! If the schema define directives that are not supported by the specified version (in the override parameter) the schema Here's the tweet text:
|
# added negative and backward-compatibility tests
@iotflowadmin thanks for the PR, I was wondering if we could specify the federation version when creating the schema instead, that way we could also disable some newer directives, what do you think? |
@patrick91 - I think you are right, that would be a better approach. (it will enable to add some sort of IDE plugin at least for the common once, to validate on the fly that the select version actually support all the directives - should not be too hard with static code inspection). but after digging a bit deeper in the code, I sow that it will include more effort (addressing it in more components that take place in runtime, and not only in generation.) and I just needed a quick fix cause I was testing migration from the guild which support up to 2.7 to wundergraph which currently support up to 2.5 (and found when looking around several people with same issue most of them just eventually changed it manually). I think its still worth while adding it to the schema creation and may be I will send another PR when I find a bit more time to fiddle with it, but this tow approaches do not necessarily cancel each other and can serve for different purposes |
Description
Added option for the export_schema command to override the output federation version.
ussage example: strawberry export-schema --federation-version=2.5
This change ONLY effect "strawberry export-schema" command and is fully backword-compatible without any logic change.
This enhancement is required to be able to work with routers (like: wundergraph cosmo - which currently support federation version only up to 2.5, or to use in organizations that can't currently update the federation version support of the router)
Warning: Please use with caution!!
If the schema define directives that are not supported by the specified version (in the override parameter) the schema
will still generate the output useing the value from the override, and may break at runtime.
Types of Changes
Checklist