Skip to content

Commit 841d058

Browse files
committed
Fix minor deviations from original
1 parent 8175d8a commit 841d058

10 files changed

+13
-15
lines changed

src/graphql/validation/rules/known_argument_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def unknown_directive_arg_message(
2828
arg_name: str, directive_name: str, suggested_args: List[str]
2929
) -> str:
3030
hint = did_you_mean([f"'{s}'" for s in suggested_args])
31-
return f"Unknown argument '{arg_name}' on directive '@{directive_name}'. {hint}"
31+
return f"Unknown argument '{arg_name}' on directive '@{directive_name}'.{hint}"
3232

3333

3434
class KnownArgumentNamesOnDirectivesRule(ASTValidationRule):

src/graphql/validation/rules/known_directives.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def enter_directive(self, node: DirectiveNode, _key, _parent, _path, ancestors):
6161
if candidate_location and candidate_location not in locations:
6262
self.report_error(
6363
GraphQLError(
64-
misplaced_directive_message(
65-
node.name.value, candidate_location.value
66-
),
64+
misplaced_directive_message(name, candidate_location.value),
6765
node,
6866
)
6967
)

src/graphql/validation/rules/possible_type_extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def extending_unknown_type_message(type_name: str, suggested_types: List[str]) -
2828

2929

3030
def extending_different_type_kind_message(type_name: str, kind: str) -> str:
31-
return f"Cannot extend non-{kind} type {type_name}"
31+
return f"Cannot extend non-{kind} type '{type_name}'."
3232

3333

3434
class PossibleTypeExtensionsRule(SDLValidationRule):

src/graphql/validation/rules/scalar_leafs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212

1313
def no_subselection_allowed_message(field_name: str, type_: str) -> str:
1414
return (
15-
f"Field '{field_name}' must not have a sub selection"
15+
f"Field '{field_name}' must not have a selection"
1616
f" since type '{type_}' has no subfields."
1717
)
1818

1919

2020
def required_subselection_message(field_name: str, type_: str) -> str:
2121
return (
22-
f"Field '{field_name}' of type '{type_}' must have a"
23-
" sub selection of subfields."
22+
f"Field '{field_name}' of type '{type_}' must have a selection of subfields."
2423
f" Did you mean '{field_name} {{ ... }}'?"
2524
)
2625

src/graphql/validation/rules/unique_argument_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def duplicate_arg_message(arg_name: str) -> str:
11-
return f"There can only be one argument named '{arg_name}'."
11+
return f"There can be only one argument named '{arg_name}'."
1212

1313

1414
class UniqueArgumentNamesRule(ASTValidationRule):

src/graphql/validation/rules/unique_fragment_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def duplicate_fragment_name_message(frag_name: str) -> str:
11-
return f"There can only be one fragment named '{frag_name}'."
11+
return f"There can be only one fragment named '{frag_name}'."
1212

1313

1414
class UniqueFragmentNamesRule(ASTValidationRule):

src/graphql/validation/rules/unique_input_field_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def duplicate_input_field_message(field_name: str) -> str:
11-
return f"There can only be one input field named '{field_name}'."
11+
return f"There can be only one input field named '{field_name}'."
1212

1313

1414
class UniqueInputFieldNamesRule(ASTValidationRule):

src/graphql/validation/rules/unique_operation_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def duplicate_operation_name_message(operation_name: str) -> str:
11-
return f"There can only be one operation named '{operation_name}'."
11+
return f"There can be only one operation named '{operation_name}'."
1212

1313

1414
class UniqueOperationNamesRule(ASTValidationRule):

src/graphql/validation/rules/unique_operation_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919

2020
def duplicate_operation_type_message(operation: str) -> str:
21-
return f"There can be only one '{operation}' type in schema."
21+
return f"There can be only one {operation} type in schema."
2222

2323

2424
def existed_operation_type_message(operation: str) -> str:
2525
return (
26-
f"Type for '{operation}' already defined in the schema."
26+
f"Type for {operation} already defined in the schema."
2727
" It cannot be redefined."
2828
)
2929

src/graphql/validation/rules/values_of_correct_type.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
__all__ = [
3333
"ValuesOfCorrectTypeRule",
3434
"bad_value_message",
35+
"bad_enum_value_message",
3536
"required_field_message",
3637
"unknown_field_message",
3738
]
@@ -63,7 +64,7 @@ def unknown_field_message(
6364
type_name: str, field_name: str, suggested_fields: Sequence[str]
6465
) -> str:
6566
hint = did_you_mean(suggested_fields)
66-
return f"Field '{field_name}'' is not defined by type {type_name}.{hint}"
67+
return f"Field '{field_name}' is not defined by type {type_name}.{hint}"
6768

6869

6970
class ValuesOfCorrectTypeRule(ValidationRule):

0 commit comments

Comments
 (0)