@@ -33,6 +33,7 @@ public static class Options {
3333 private final boolean descriptions ;
3434
3535 private final boolean specifiedByUrl ;
36+ private final boolean isOneOf ;
3637
3738 private final boolean directiveIsRepeatable ;
3839
@@ -44,12 +45,14 @@ public static class Options {
4445
4546 private Options (boolean descriptions ,
4647 boolean specifiedByUrl ,
48+ boolean isOneOf ,
4749 boolean directiveIsRepeatable ,
4850 boolean schemaDescription ,
4951 boolean inputValueDeprecation ,
5052 int typeRefFragmentDepth ) {
5153 this .descriptions = descriptions ;
5254 this .specifiedByUrl = specifiedByUrl ;
55+ this .isOneOf = isOneOf ;
5356 this .directiveIsRepeatable = directiveIsRepeatable ;
5457 this .schemaDescription = schemaDescription ;
5558 this .inputValueDeprecation = inputValueDeprecation ;
@@ -64,6 +67,10 @@ public boolean isSpecifiedByUrl() {
6467 return specifiedByUrl ;
6568 }
6669
70+ public boolean isOneOf () {
71+ return isOneOf ;
72+ }
73+
6774 public boolean isDirectiveIsRepeatable () {
6875 return directiveIsRepeatable ;
6976 }
@@ -85,6 +92,7 @@ public static Options defaultOptions() {
8592 true ,
8693 false ,
8794 true ,
95+ true ,
8896 false ,
8997 true ,
9098 7
@@ -101,6 +109,7 @@ public static Options defaultOptions() {
101109 public Options descriptions (boolean flag ) {
102110 return new Options (flag ,
103111 this .specifiedByUrl ,
112+ this .isOneOf ,
104113 this .directiveIsRepeatable ,
105114 this .schemaDescription ,
106115 this .inputValueDeprecation ,
@@ -117,12 +126,32 @@ public Options descriptions(boolean flag) {
117126 public Options specifiedByUrl (boolean flag ) {
118127 return new Options (this .descriptions ,
119128 flag ,
129+ this .isOneOf ,
120130 this .directiveIsRepeatable ,
121131 this .schemaDescription ,
122132 this .inputValueDeprecation ,
123133 this .typeRefFragmentDepth );
124134 }
125135
136+ /**
137+ * This will allow you to include the `isOneOf` field for one of input types in the introspection query.
138+ * <p>
139+ * This option is only needed while `@oneOf` input types are new and in time the reason for this
140+ * option will go away.
141+ *
142+ * @param flag whether to include them
143+ *
144+ * @return options
145+ */
146+ public Options isOneOf (boolean flag ) {
147+ return new Options (this .descriptions ,
148+ this .specifiedByUrl ,
149+ flag ,
150+ this .directiveIsRepeatable ,
151+ this .schemaDescription ,
152+ this .inputValueDeprecation ,
153+ this .typeRefFragmentDepth );
154+ }
126155 /**
127156 * This will allow you to include the `isRepeatable` field for directives in the introspection query.
128157 *
@@ -133,6 +162,7 @@ public Options specifiedByUrl(boolean flag) {
133162 public Options directiveIsRepeatable (boolean flag ) {
134163 return new Options (this .descriptions ,
135164 this .specifiedByUrl ,
165+ this .isOneOf ,
136166 flag ,
137167 this .schemaDescription ,
138168 this .inputValueDeprecation ,
@@ -149,6 +179,7 @@ public Options directiveIsRepeatable(boolean flag) {
149179 public Options schemaDescription (boolean flag ) {
150180 return new Options (this .descriptions ,
151181 this .specifiedByUrl ,
182+ this .isOneOf ,
152183 this .directiveIsRepeatable ,
153184 flag ,
154185 this .inputValueDeprecation ,
@@ -165,6 +196,7 @@ public Options schemaDescription(boolean flag) {
165196 public Options inputValueDeprecation (boolean flag ) {
166197 return new Options (this .descriptions ,
167198 this .specifiedByUrl ,
199+ this .isOneOf ,
168200 this .directiveIsRepeatable ,
169201 this .schemaDescription ,
170202 flag ,
@@ -181,6 +213,7 @@ public Options inputValueDeprecation(boolean flag) {
181213 public Options typeRefFragmentDepth (int typeRefFragmentDepth ) {
182214 return new Options (this .descriptions ,
183215 this .specifiedByUrl ,
216+ this .isOneOf ,
184217 this .directiveIsRepeatable ,
185218 this .schemaDescription ,
186219 this .inputValueDeprecation ,
@@ -249,6 +282,7 @@ public static Document buildDocument(Options options) {
249282 newField ("name" ).build (),
250283 options .descriptions ? newField ("description" ).build () : null ,
251284 options .specifiedByUrl ? newField ("specifiedByURL" ).build () : null ,
285+ options .isOneOf ? newField ("isOneOf" ).build () : null ,
252286 newField ("fields" )
253287 .arguments (ImmutableList .of (
254288 newArgument ("includeDeprecated" , BooleanValue .of (true )).build ()
0 commit comments