Skip to content

Commit a33a13c

Browse files
[Fusion] Fix __Directive.locations and __Type.ofType resolvers (#8751)
1 parent e4ba262 commit a33a13c

22 files changed

+3098
-129
lines changed
Lines changed: 64 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,78 @@
1-
query IntrospectionQuery {
2-
__schema {
3-
queryType { name }
4-
mutationType { name }
5-
subscriptionType { name }
6-
types {
7-
...FullType
8-
}
9-
directives {
10-
name
11-
description
12-
args(includeDeprecated: true) {
13-
...InputValue
14-
}
15-
onOperation
16-
onFragment
17-
onField
18-
}
1+
query IntrospectionQuery {
2+
__schema {
3+
queryType {
4+
name
195
}
20-
}
21-
22-
fragment FullType on __Type {
23-
kind
24-
name
25-
description
26-
fields(includeDeprecated: true) {
6+
mutationType {
277
name
28-
description
29-
args(includeDeprecated: true) {
30-
...InputValue
31-
}
32-
type {
33-
...TypeRef
34-
}
35-
isDeprecated
36-
deprecationReason
378
}
38-
inputFields(includeDeprecated: true) {
39-
...InputValue
9+
subscriptionType {
10+
name
4011
}
41-
interfaces {
42-
...TypeRef
12+
types {
13+
...FullType
4314
}
44-
enumValues(includeDeprecated: true) {
15+
directives {
4516
name
4617
description
47-
isDeprecated
48-
deprecationReason
18+
isRepeatable
19+
args(includeDeprecated: true) {
20+
...InputValue
21+
}
22+
locations
23+
onOperation
24+
onFragment
25+
onField
4926
}
50-
possibleTypes {
27+
}
28+
}
29+
fragment FullType on __Type {
30+
kind
31+
name
32+
description
33+
specifiedByURL
34+
fields(includeDeprecated: true) {
35+
name
36+
description
37+
args(includeDeprecated: true) {
38+
...InputValue
39+
}
40+
type {
5141
...TypeRef
5242
}
43+
isDeprecated
44+
deprecationReason
45+
}
46+
inputFields(includeDeprecated: true) {
47+
...InputValue
5348
}
54-
55-
fragment InputValue on __InputValue {
49+
interfaces {
50+
...TypeRef
51+
}
52+
enumValues(includeDeprecated: true) {
5653
name
5754
description
58-
type { ...TypeRef }
59-
defaultValue
6055
isDeprecated
6156
deprecationReason
6257
}
63-
64-
fragment TypeRef on __Type {
58+
possibleTypes {
59+
...TypeRef
60+
}
61+
}
62+
fragment InputValue on __InputValue {
63+
name
64+
description
65+
type {
66+
...TypeRef
67+
}
68+
defaultValue
69+
isDeprecated
70+
deprecationReason
71+
}
72+
fragment TypeRef on __Type {
73+
kind
74+
name
75+
ofType {
6576
kind
6677
name
6778
ofType {
@@ -73,7 +84,12 @@
7384
ofType {
7485
kind
7586
name
87+
ofType {
88+
kind
89+
name
90+
}
7691
}
7792
}
7893
}
7994
}
95+
}

src/HotChocolate/Core/test/Execution.Tests/__snapshots__/IntrospectionTests.DefaultValueIsInputObject.snap

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"kind": "OBJECT",
1212
"name": "__Directive",
1313
"description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",
14+
"specifiedByURL": null,
1415
"fields": [
1516
{
1617
"name": "name",
@@ -55,7 +56,8 @@
5556
"name": null,
5657
"ofType": {
5758
"kind": "ENUM",
58-
"name": "__DirectiveLocation"
59+
"name": "__DirectiveLocation",
60+
"ofType": null
5961
}
6062
}
6163
}
@@ -95,7 +97,8 @@
9597
"name": null,
9698
"ofType": {
9799
"kind": "OBJECT",
98-
"name": "__InputValue"
100+
"name": "__InputValue",
101+
"ofType": null
99102
}
100103
}
101104
}
@@ -177,6 +180,7 @@
177180
"kind": "ENUM",
178181
"name": "__DirectiveLocation",
179182
"description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",
183+
"specifiedByURL": null,
180184
"fields": null,
181185
"inputFields": null,
182186
"interfaces": null,
@@ -302,6 +306,7 @@
302306
"kind": "OBJECT",
303307
"name": "__EnumValue",
304308
"description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",
309+
"specifiedByURL": null,
305310
"fields": [
306311
{
307312
"name": "name",
@@ -369,6 +374,7 @@
369374
"kind": "OBJECT",
370375
"name": "__Field",
371376
"description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",
377+
"specifiedByURL": null,
372378
"fields": [
373379
{
374380
"name": "name",
@@ -430,7 +436,8 @@
430436
"name": null,
431437
"ofType": {
432438
"kind": "OBJECT",
433-
"name": "__InputValue"
439+
"name": "__InputValue",
440+
"ofType": null
434441
}
435442
}
436443
}
@@ -492,6 +499,7 @@
492499
"kind": "OBJECT",
493500
"name": "__InputValue",
494501
"description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",
502+
"specifiedByURL": null,
495503
"fields": [
496504
{
497505
"name": "name",
@@ -587,6 +595,7 @@
587595
"kind": "OBJECT",
588596
"name": "__Schema",
589597
"description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",
598+
"specifiedByURL": null,
590599
"fields": [
591600
{
592601
"name": "description",
@@ -615,7 +624,8 @@
615624
"name": null,
616625
"ofType": {
617626
"kind": "OBJECT",
618-
"name": "__Type"
627+
"name": "__Type",
628+
"ofType": null
619629
}
620630
}
621631
}
@@ -678,7 +688,8 @@
678688
"name": null,
679689
"ofType": {
680690
"kind": "OBJECT",
681-
"name": "__Directive"
691+
"name": "__Directive",
692+
"ofType": null
682693
}
683694
}
684695
}
@@ -696,6 +707,7 @@
696707
"kind": "OBJECT",
697708
"name": "__Type",
698709
"description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, 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.",
710+
"specifiedByURL": null,
699711
"fields": [
700712
{
701713
"name": "kind",
@@ -934,6 +946,7 @@
934946
"kind": "ENUM",
935947
"name": "__TypeKind",
936948
"description": "An enum describing what kind of type a given `__Type` is.",
949+
"specifiedByURL": null,
937950
"fields": null,
938951
"inputFields": null,
939952
"interfaces": null,
@@ -993,6 +1006,7 @@
9931006
"kind": "OBJECT",
9941007
"name": "Bar",
9951008
"description": null,
1009+
"specifiedByURL": null,
9961010
"fields": [
9971011
{
9981012
"name": "a",
@@ -1029,6 +1043,7 @@
10291043
"kind": "SCALAR",
10301044
"name": "String",
10311045
"description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
1046+
"specifiedByURL": null,
10321047
"fields": null,
10331048
"inputFields": null,
10341049
"interfaces": null,
@@ -1039,6 +1054,7 @@
10391054
"kind": "SCALAR",
10401055
"name": "Boolean",
10411056
"description": "The `Boolean` scalar type represents `true` or `false`.",
1057+
"specifiedByURL": null,
10421058
"fields": null,
10431059
"inputFields": null,
10441060
"interfaces": null,
@@ -1049,6 +1065,7 @@
10491065
"kind": "INPUT_OBJECT",
10501066
"name": "Baz",
10511067
"description": null,
1068+
"specifiedByURL": null,
10521069
"fields": null,
10531070
"inputFields": [
10541071
{
@@ -1073,6 +1090,7 @@
10731090
{
10741091
"name": "skip",
10751092
"description": "Directs the executor to skip this field or fragment when the `if` argument is true.",
1093+
"isRepeatable": false,
10761094
"args": [
10771095
{
10781096
"name": "if",
@@ -1091,13 +1109,19 @@
10911109
"deprecationReason": null
10921110
}
10931111
],
1112+
"locations": [
1113+
"FIELD",
1114+
"FRAGMENT_SPREAD",
1115+
"INLINE_FRAGMENT"
1116+
],
10941117
"onOperation": false,
10951118
"onFragment": true,
10961119
"onField": true
10971120
},
10981121
{
10991122
"name": "include",
11001123
"description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
1124+
"isRepeatable": false,
11011125
"args": [
11021126
{
11031127
"name": "if",
@@ -1116,13 +1140,19 @@
11161140
"deprecationReason": null
11171141
}
11181142
],
1143+
"locations": [
1144+
"FIELD",
1145+
"FRAGMENT_SPREAD",
1146+
"INLINE_FRAGMENT"
1147+
],
11191148
"onOperation": false,
11201149
"onFragment": true,
11211150
"onField": true
11221151
},
11231152
{
11241153
"name": "deprecated",
11251154
"description": "The @deprecated directive is used within the type system definition language to indicate deprecated portions of a GraphQL service’s schema,such as deprecated fields on a type or deprecated enum values.",
1155+
"isRepeatable": false,
11261156
"args": [
11271157
{
11281158
"name": "reason",
@@ -1137,6 +1167,12 @@
11371167
"deprecationReason": null
11381168
}
11391169
],
1170+
"locations": [
1171+
"FIELD_DEFINITION",
1172+
"ARGUMENT_DEFINITION",
1173+
"ENUM_VALUE",
1174+
"INPUT_FIELD_DEFINITION"
1175+
],
11401176
"onOperation": false,
11411177
"onFragment": false,
11421178
"onField": false

0 commit comments

Comments
 (0)