Skip to content

Commit ac4ca69

Browse files
committed
Use specifiedByURL instead of specifiedByUrl
Replicates graphql/graphql-js@2d48fbb
1 parent 766b4f1 commit ac4ca69

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

src/graphql/type/introspection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
" by the `__TypeKind` enum.\n\nDepending on the kind of a"
201201
" type, certain fields describe information about that type."
202202
" Scalar types provide no information beyond a name, description"
203-
" and optional `specifiedByUrl`, while Enum types provide their values."
203+
" and optional `specifiedByURL`, while Enum types provide their values."
204204
" Object and Interface types provide the fields they describe."
205205
" Abstract types, Union and Interface, provide the Object"
206206
" types possible at runtime. List and NonNull types compose"
@@ -213,7 +213,7 @@
213213
"description": GraphQLField(
214214
GraphQLString, resolve=TypeFieldResolvers.description
215215
),
216-
"specifiedByUrl": GraphQLField(
216+
"specifiedByURL": GraphQLField(
217217
GraphQLString, resolve=TypeFieldResolvers.specified_by_url
218218
),
219219
"fields": GraphQLField(

src/graphql/utilities/build_client_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def build_scalar_def(scalar_introspection: Dict) -> GraphQLScalarType:
115115
return GraphQLScalarType(
116116
name=scalar_introspection["name"],
117117
description=scalar_introspection.get("description"),
118-
specified_by_url=scalar_introspection.get("specifiedByUrl"),
118+
specified_by_url=scalar_introspection.get("specifiedByURL"),
119119
)
120120

121121
def build_implementations_list(

src/graphql/utilities/extend_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ def get_deprecation_reason(
688688
def get_specified_by_url(
689689
node: Union[ScalarTypeDefinitionNode, ScalarTypeExtensionNode]
690690
) -> Optional[str]:
691-
"""Given a scalar node, return the string value for the specifiedByUrl."""
691+
"""Given a scalar node, return the string value for the specifiedByURL."""
692692
from ..execution import get_directive_values
693693

694694
specified_by_url = get_directive_values(GraphQLSpecifiedByDirective, node)

src/graphql/utilities/get_introspection_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_introspection_query(
1818
the schema description as well.
1919
"""
2020
maybe_description = "description" if descriptions else ""
21-
maybe_specified_by_url = "specifiedByUrl" if specified_by_url else ""
21+
maybe_specified_by_url = "specifiedByURL" if specified_by_url else ""
2222
maybe_directive_is_repeatable = "isRepeatable" if directive_is_repeatable else ""
2323
maybe_schema_description = maybe_description if schema_description else ""
2424

src/graphql/utilities/print_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def print_specified_by_url(scalar: GraphQLScalarType) -> str:
271271
url_ast = ast_from_value(url, GraphQLString)
272272
if not url_ast: # pragma: no cover
273273
raise TypeError(
274-
"Unexpected null value returned from `ast_from_value` for specifiedByUrl."
274+
"Unexpected null value returned from `ast_from_value` for specifiedByURL."
275275
)
276276
return f" @specifiedBy(url: {print_ast(url_ast)})"
277277

tests/type/test_introspection.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def executes_an_introspection_query():
3131
{
3232
"kind": "OBJECT",
3333
"name": "SomeObject",
34-
"specifiedByUrl": None,
34+
"specifiedByURL": None,
3535
"fields": [
3636
{
3737
"name": "someField",
@@ -53,7 +53,7 @@ def executes_an_introspection_query():
5353
{
5454
"kind": "SCALAR",
5555
"name": "String",
56-
"specifiedByUrl": None,
56+
"specifiedByURL": None,
5757
"fields": None,
5858
"inputFields": None,
5959
"interfaces": None,
@@ -63,7 +63,7 @@ def executes_an_introspection_query():
6363
{
6464
"kind": "SCALAR",
6565
"name": "Boolean",
66-
"specifiedByUrl": None,
66+
"specifiedByURL": None,
6767
"fields": None,
6868
"inputFields": None,
6969
"interfaces": None,
@@ -73,7 +73,7 @@ def executes_an_introspection_query():
7373
{
7474
"kind": "OBJECT",
7575
"name": "__Schema",
76-
"specifiedByUrl": None,
76+
"specifiedByURL": None,
7777
"fields": [
7878
{
7979
"name": "description",
@@ -178,7 +178,7 @@ def executes_an_introspection_query():
178178
{
179179
"kind": "OBJECT",
180180
"name": "__Type",
181-
"specifiedByUrl": None,
181+
"specifiedByURL": None,
182182
"fields": [
183183
{
184184
"name": "kind",
@@ -218,7 +218,7 @@ def executes_an_introspection_query():
218218
"deprecationReason": None,
219219
},
220220
{
221-
"name": "specifiedByUrl",
221+
"name": "specifiedByURL",
222222
"args": [],
223223
"type": {
224224
"kind": "SCALAR",
@@ -373,7 +373,7 @@ def executes_an_introspection_query():
373373
{
374374
"kind": "ENUM",
375375
"name": "__TypeKind",
376-
"specifiedByUrl": None,
376+
"specifiedByURL": None,
377377
"fields": None,
378378
"inputFields": None,
379379
"interfaces": None,
@@ -424,7 +424,7 @@ def executes_an_introspection_query():
424424
{
425425
"kind": "OBJECT",
426426
"name": "__Field",
427-
"specifiedByUrl": None,
427+
"specifiedByURL": None,
428428
"fields": [
429429
{
430430
"name": "name",
@@ -535,7 +535,7 @@ def executes_an_introspection_query():
535535
{
536536
"kind": "OBJECT",
537537
"name": "__InputValue",
538-
"specifiedByUrl": None,
538+
"specifiedByURL": None,
539539
"fields": [
540540
{
541541
"name": "name",
@@ -624,7 +624,7 @@ def executes_an_introspection_query():
624624
{
625625
"kind": "OBJECT",
626626
"name": "__EnumValue",
627-
"specifiedByUrl": None,
627+
"specifiedByURL": None,
628628
"fields": [
629629
{
630630
"name": "name",
@@ -687,7 +687,7 @@ def executes_an_introspection_query():
687687
{
688688
"kind": "OBJECT",
689689
"name": "__Directive",
690-
"specifiedByUrl": None,
690+
"specifiedByURL": None,
691691
"fields": [
692692
{
693693
"name": "name",
@@ -785,7 +785,7 @@ def executes_an_introspection_query():
785785
{
786786
"kind": "ENUM",
787787
"name": "__DirectiveLocation",
788-
"specifiedByUrl": None,
788+
"specifiedByURL": None,
789789
"fields": None,
790790
"inputFields": None,
791791
"interfaces": None,

tests/utilities/test_get_introspection_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def includes_description_field_on_schema():
4444
).to_not_match("description")
4545

4646
def includes_specified_by_url_field():
47-
ExcpectIntrospectionQuery().to_not_match("specifiedByUrl")
48-
ExcpectIntrospectionQuery(specified_by_url=True).to_match("specifiedByUrl")
49-
ExcpectIntrospectionQuery(specified_by_url=False).to_not_match("specifiedByUrl")
47+
ExcpectIntrospectionQuery().to_not_match("specifiedByURL")
48+
ExcpectIntrospectionQuery(specified_by_url=True).to_match("specifiedByURL")
49+
ExcpectIntrospectionQuery(specified_by_url=False).to_not_match("specifiedByURL")
5050

5151
def includes_is_deprecated_field_on_input_values():
5252
ExcpectIntrospectionQuery().to_match("isDeprecated", 2)

tests/utilities/test_print_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,13 +673,13 @@ def prints_introspection_schema():
673673
"""
674674
The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.
675675
676-
Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.
676+
Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.
677677
"""
678678
type __Type {
679679
kind: __TypeKind!
680680
name: String
681681
description: String
682-
specifiedByUrl: String
682+
specifiedByURL: String
683683
fields(includeDeprecated: Boolean = false): [__Field!]
684684
interfaces: [__Type!]
685685
possibleTypes: [__Type!]

0 commit comments

Comments
 (0)