Skip to content

Commit d91a8eb

Browse files
committed
__Type.isOneOf is implemented on __Type so isn't specific to input objects
1 parent dbeac39 commit d91a8eb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/utilities/__tests__/getIntrospectionQuery-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ describe('getIntrospectionQuery', () => {
120120
it('include "isOneOf" field on input objects', () => {
121121
expectIntrospectionQuery().toNotMatch('isOneOf');
122122

123-
expectIntrospectionQuery({ inputObjectOneOf: true }).toMatch('isOneOf', 1);
123+
expectIntrospectionQuery({ oneOf: true }).toMatch('isOneOf', 1);
124124

125-
expectIntrospectionQuery({ inputObjectOneOf: false }).toNotMatch('isOneOf');
125+
expectIntrospectionQuery({ oneOf: false }).toNotMatch('isOneOf');
126126
});
127127

128128
it('include deprecated input field and args', () => {

src/utilities/getIntrospectionQuery.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface IntrospectionOptions {
3737
* Whether target GraphQL server supports `@oneOf` input objects.
3838
* Default: false
3939
*/
40-
inputObjectOneOf?: boolean;
40+
oneOf?: boolean;
4141
}
4242

4343
/**
@@ -51,7 +51,7 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
5151
directiveIsRepeatable: false,
5252
schemaDescription: false,
5353
inputValueDeprecation: false,
54-
inputObjectOneOf: false,
54+
oneOf: false,
5555
...options,
5656
};
5757

@@ -69,7 +69,7 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
6969
function inputDeprecation(str: string) {
7070
return optionsWithDefault.inputValueDeprecation ? str : '';
7171
}
72-
const inputObjectOneOf = optionsWithDefault.inputObjectOneOf ? 'isOneOf' : '';
72+
const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : '';
7373

7474
return `
7575
query IntrospectionQuery {
@@ -98,7 +98,7 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
9898
name
9999
${descriptions}
100100
${specifiedByUrl}
101-
${inputObjectOneOf}
101+
${oneOf}
102102
fields(includeDeprecated: true) {
103103
name
104104
${descriptions}

src/utilities/introspectionFromSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function introspectionFromSchema(
3030
directiveIsRepeatable: true,
3131
schemaDescription: true,
3232
inputValueDeprecation: true,
33-
inputObjectOneOf: true,
33+
oneOf: true,
3434
...options,
3535
};
3636

0 commit comments

Comments
 (0)