Skip to content

Commit

Permalink
Typing fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
denisart committed Dec 14, 2023
1 parent 9752216 commit 3ec150f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions graphql_query/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def _get_field_template(field_info: PydanticFieldInfo) -> Field:
directives: List[Directive] = []
typename: bool = False

if (field_info.json_schema_extra is not None) and isinstance(type(field_info.json_schema_extra), dict):
alias = field_info.json_schema_extra.get("graphql_alias", None)
arguments = field_info.json_schema_extra.get("graphql_arguments", [])
directives = field_info.json_schema_extra.get("graphql_directives", [])
typename = field_info.json_schema_extra.get("graphql_typename", False)
if (field_info.json_schema_extra is not None) and isinstance(field_info.json_schema_extra, dict):
alias = field_info.json_schema_extra.get("graphql_alias", None) # type: ignore
arguments = field_info.json_schema_extra.get("graphql_arguments", []) # type: ignore
directives = field_info.json_schema_extra.get("graphql_directives", []) # type: ignore
typename = field_info.json_schema_extra.get("graphql_typename", False) # type: ignore

return Field(name="<NAME>", fields=[], alias=alias, arguments=arguments, directives=directives, typename=typename)

Expand Down

0 comments on commit 3ec150f

Please sign in to comment.