Skip to content

Commit 102ba85

Browse files
committed
introspection_from_schema: enable 'specified_by_url' by default
Replicates graphql/graphql-js@8c6e7c7
1 parent 32940e6 commit 102ba85

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/graphql/utilities/introspection_from_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def introspection_from_schema(
1515
schema: GraphQLSchema,
1616
descriptions: bool = True,
17-
specified_by_url: bool = False,
17+
specified_by_url: bool = True,
1818
directive_is_repeatable: bool = True,
1919
schema_description: bool = True,
2020
) -> IntrospectionSchema:

tests/utilities/test_build_client_schema.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ def cycle_introspection(sdl_string):
3232
build in-memory GraphQLSchema from it, produce a client-side representation of the
3333
schema by using "build_client_schema" and then return that schema printed as SDL.
3434
"""
35-
options = dict(specified_by_url=True, directive_is_repeatable=True)
36-
3735
server_schema = build_schema(sdl_string)
38-
initial_introspection = introspection_from_schema(server_schema, **options)
36+
initial_introspection = introspection_from_schema(server_schema)
3937
client_schema = build_client_schema(initial_introspection)
4038
# If the client then runs the introspection query against the client-side schema,
4139
# it should get a result identical to what was returned by the server
42-
second_introspection = introspection_from_schema(client_schema, **options)
40+
second_introspection = introspection_from_schema(client_schema)
4341

4442
# If the client then runs the introspection query against the client-side
4543
# schema, it should get a result identical to what was returned by the server.

tests/utilities/test_introspection_from_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ def describe_introspection_from_schema():
2525
)
2626
},
2727
description="This is a simple type",
28-
)
28+
),
29+
description='This is a simple schema'
2930
)
3031

3132
def converts_a_simple_schema():
3233
introspection = introspection_from_schema(schema)
3334

3435
assert introspection_to_sdl(introspection) == dedent(
3536
'''
37+
"""This is a simple schema"""
3638
schema {
3739
query: Simple
3840
}

0 commit comments

Comments
 (0)