Skip to content

Commit

Permalink
rewrite errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnnsrs committed Jun 25, 2024
1 parent 1df9492 commit b63a9f4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions turms/plugins/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def generate_operation(
arg="default",
value=ast.Constant(
value=parse_value_node(v.default_value)
if v.default_value
if v.default_value is not None
else None
),
),
Expand Down Expand Up @@ -290,7 +290,7 @@ def generate_operation(
arg="default",
value=ast.Constant(
value=parse_value_node(v.default_value)
if v.default_value
if v.default_value is not None
else None
),
),
Expand Down
2 changes: 1 addition & 1 deletion turms/recurse.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class X(BaseModel):
)

if isinstance(sub_node, InlineFragmentNode):
raise NotImplementedError()
raise NotImplementedError("Inline Fragments are not yet implemented")

body = pick_fields if pick_fields else [ast.Pass()]

Expand Down
1 change: 1 addition & 0 deletions turms/turms
4 changes: 2 additions & 2 deletions turms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def recurse_type_annotation(
type.name.value, "", allow_forward=False
)
except NoEnumFound:
raise NotImplementedError("Not implemented")
raise NotImplementedError(f"Could not find corresponding type for type '{type.name.value}'. Did you register this scalar?")

if not x:
raise Exception(f"Could not set value for {type}")
Expand Down Expand Up @@ -584,7 +584,7 @@ def recurse_type_label(
type.name.value, "", allow_forward=False
)
except NoEnumFound:
raise NotImplementedError("Not implemented")
raise NotImplementedError(f"Could not find correspoinding type labler for {type.name.value}")

if optional:
return "Optional[" + x.id + "]"
Expand Down

0 comments on commit b63a9f4

Please sign in to comment.