-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility with graphql-core v3.2 (#83)
* Fix usage of collect_fields in graphql_utils * Make usage get_field_def compatible with v3.2 * Workaround failing test * Try bumping python version on CI
- Loading branch information
Showing
5 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
import graphql | ||
from graphql import GraphQLSchema, GraphQLObjectType, FieldNode | ||
from graphql.execution.execute import get_field_def | ||
|
||
noop = lambda *args, **kwargs: None | ||
|
||
|
||
def is_iterable(obj): | ||
return hasattr(obj, "__iter__") and not isinstance(obj, str) | ||
|
||
|
||
def get_field_def_compat( | ||
schema: GraphQLSchema, parent_type: GraphQLObjectType, field_node: FieldNode | ||
): | ||
return get_field_def( | ||
schema, | ||
parent_type, | ||
field_node.name.value if graphql.version_info < (3, 2) else field_node, | ||
) |
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 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