Skip to content

Commit 9d09caf

Browse files
committed
Rename input_object_one_of` to one_of in get_introspection_query
Replicates graphql/graphql-js@ac553f8
1 parent 9823664 commit 9d09caf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/graphql/utilities/get_introspection_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_introspection_query(
4343
directive_is_repeatable: bool = False,
4444
schema_description: bool = False,
4545
input_value_deprecation: bool = False,
46-
input_object_one_of: bool = False,
46+
one_of: bool = False,
4747
) -> str:
4848
"""Get a query for introspection.
4949
@@ -55,7 +55,7 @@ def get_introspection_query(
5555
maybe_specified_by_url = "specifiedByURL" if specified_by_url else ""
5656
maybe_directive_is_repeatable = "isRepeatable" if directive_is_repeatable else ""
5757
maybe_schema_description = maybe_description if schema_description else ""
58-
maybe_input_object_one_of = "isOneOf" if input_object_one_of else ""
58+
maybe_one_of = "isOneOf" if one_of else ""
5959

6060
def input_deprecation(string: str) -> str | None:
6161
return string if input_value_deprecation else ""
@@ -88,7 +88,7 @@ def input_deprecation(string: str) -> str | None:
8888
name
8989
{maybe_description}
9090
{maybe_specified_by_url}
91-
{maybe_input_object_one_of}
91+
{maybe_one_of}
9292
fields(includeDeprecated: true) {{
9393
name
9494
{maybe_description}

src/graphql/utilities/introspection_from_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def introspection_from_schema(
2121
directive_is_repeatable: bool = True,
2222
schema_description: bool = True,
2323
input_value_deprecation: bool = True,
24-
input_object_one_of: bool = True,
24+
one_of: bool = True,
2525
) -> IntrospectionQuery:
2626
"""Build an IntrospectionQuery from a GraphQLSchema
2727
@@ -38,7 +38,7 @@ def introspection_from_schema(
3838
directive_is_repeatable,
3939
schema_description,
4040
input_value_deprecation,
41-
input_object_one_of,
41+
one_of,
4242
)
4343
)
4444

tests/utilities/test_get_introspection_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ def includes_deprecation_reason_field_on_input_values():
8080
"deprecationReason", 2
8181
)
8282

83-
def includes_input_object_one_of_field():
83+
def includes_is_one_of_on_input_objects():
8484
ExcpectIntrospectionQuery().to_not_match("isOneOf")
85-
ExcpectIntrospectionQuery(input_object_one_of=True).to_match("isOneOf")
86-
ExcpectIntrospectionQuery(input_object_one_of=False).to_not_match("isOneOf")
85+
ExcpectIntrospectionQuery(one_of=True).to_match("isOneOf")
86+
ExcpectIntrospectionQuery(one_of=False).to_not_match("isOneOf")
8787

8888
def includes_deprecated_input_field_and_args():
8989
ExcpectIntrospectionQuery().to_match("includeDeprecated: true", 2)

0 commit comments

Comments
 (0)