Created
January 24, 2019 18:45
-
-
Save ktosiek/a309f772399482a47cf2c4ed219ff1af to your computer and use it in GitHub Desktop.
Return raw values from python graphql-core, skipping the complete_*_value functions.
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
import graphql.execution.executor | |
def complete_value(exe_context, return_type, field_asts, info, path, result): | |
if isinstance(result, RawGraphQLResult): | |
return result.value | |
return _complete_value(exe_context, return_type, field_asts, info, path, result) | |
class RawGraphQLResult: | |
def __init__(self, value): | |
self.value = value | |
_complete_value = graphql.execution.executor.complete_value | |
graphql.execution.executor.complete_value = complete_value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment