-
Notifications
You must be signed in to change notification settings - Fork 185
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
Parse custom scalar and enums in outputs #256
Merged
leszekhanusz
merged 22 commits into
graphql-python:master
from
leszekhanusz:feature_parse_results
Nov 22, 2021
Merged
Parse custom scalar and enums in outputs #256
leszekhanusz
merged 22 commits into
graphql-python:master
from
leszekhanusz:feature_parse_results
Nov 22, 2021
Conversation
This file contains 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
This function allows us to update a schema from a file or from introspection with custom scalars implementations
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## master #256 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 19 21 +2
Lines 1436 1650 +214
==========================================
+ Hits 1436 1650 +214
Continue to review full report at Codecov.
|
+ fix custom scalars serializing as lists
+ raises TypeError and KeyError instead of GraphQLErrors
leszekhanusz
changed the title
Parse custom scalar in outputs
Parse custom scalar and enums in outputs
Nov 22, 2021
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.
Adding parse_results functionality
If you add
parse_results=True
to the Client init,or if you add
parse_result=True
to the execute or subscribe methods,then gql will unserialize the result received from the backend with the scalars defined in the schema.
Note: because graphql-core PR 138 is not yet in a stable release, you might have issues with enums (parsed to
None
) if you get your schema from introspection.New utilities method to update the schema
update_schema_enum
to update an Enum in the schemaupdate_schema_scalar
to update a Scalar in the schema