File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,17 @@ export interface IntrospectionOptions {
38
38
* Default: false
39
39
*/
40
40
oneOf ?: boolean ;
41
+
42
+ /**
43
+ * Choose the type of nullability you would like to see.
44
+ *
45
+ * - AUTO: SEMANTIC if errorPropagation is set to false, otherwise TRADITIONAL
46
+ * - TRADITIONAL: all GraphQLSemanticNonNull will be unwrapped
47
+ * - SEMANTIC: all GraphQLNonNull will be converted to GraphQLSemanticNonNull
48
+ * - FULL: the true nullability will be returned
49
+ *
50
+ */
51
+ nullability ?: 'AUTO' | 'TRADITIONAL' | 'SEMANTIC' | 'FULL' ;
41
52
}
42
53
43
54
/**
@@ -52,6 +63,7 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
52
63
schemaDescription : false ,
53
64
inputValueDeprecation : false ,
54
65
oneOf : false ,
66
+ nullability : null ,
55
67
...options ,
56
68
} ;
57
69
@@ -70,6 +82,7 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
70
82
return optionsWithDefault . inputValueDeprecation ? str : '' ;
71
83
}
72
84
const oneOf = optionsWithDefault . oneOf ? 'isOneOf' : '' ;
85
+ const nullability = optionsWithDefault . nullability ;
73
86
74
87
return `
75
88
query IntrospectionQuery {
@@ -105,7 +118,7 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
105
118
args${ inputDeprecation ( '(includeDeprecated: true)' ) } {
106
119
...InputValue
107
120
}
108
- type {
121
+ type${ nullability ? `(nullability: ${ nullability } )` : `` } {
109
122
...TypeRef
110
123
}
111
124
isDeprecated
You can’t perform that action at this time.
0 commit comments