Skip to content

Commit 8c6e7c7

Browse files
introspectionFromSchema: enable 'specifiedByUrl' by default (#2852)
1 parent ce03dab commit 8c6e7c7

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/utilities/__tests__/buildClientSchema-test.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@ import { introspectionFromSchema } from '../introspectionFromSchema';
3131
* returns that schema printed as SDL.
3232
*/
3333
function cycleIntrospection(sdlString: string): string {
34-
const options = {
35-
specifiedByUrl: true,
36-
directiveIsRepeatable: true,
37-
};
38-
3934
const serverSchema = buildSchema(sdlString);
40-
const initialIntrospection = introspectionFromSchema(serverSchema, options);
35+
const initialIntrospection = introspectionFromSchema(serverSchema);
4136
const clientSchema = buildClientSchema(initialIntrospection);
42-
const secondIntrospection = introspectionFromSchema(clientSchema, options);
37+
const secondIntrospection = introspectionFromSchema(clientSchema);
4338

4439
/**
4540
* If the client then runs the introspection query against the client-side

src/utilities/__tests__/introspectionFromSchema-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function introspectionToSDL(introspection: IntrospectionQuery): string {
1818

1919
describe('introspectionFromSchema', () => {
2020
const schema = new GraphQLSchema({
21+
description: 'This is a simple schema',
2122
query: new GraphQLObjectType({
2223
name: 'Simple',
2324
description: 'This is a simple type',
@@ -34,6 +35,7 @@ describe('introspectionFromSchema', () => {
3435
const introspection = introspectionFromSchema(schema);
3536

3637
expect(introspectionToSDL(introspection)).to.deep.equal(dedent`
38+
"""This is a simple schema"""
3739
schema {
3840
query: Simple
3941
}

src/utilities/introspectionFromSchema.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function introspectionFromSchema(
2626
options?: IntrospectionOptions,
2727
): IntrospectionQuery {
2828
const optionsWithDefaults = {
29+
specifiedByUrl: true,
2930
directiveIsRepeatable: true,
3031
schemaDescription: true,
3132
...options,

0 commit comments

Comments
 (0)