Skip to content

Commit eb9d2d6

Browse files
committed
use "specifiedBy" instead of "specifiedByUrl"
1 parent 6258cd7 commit eb9d2d6

12 files changed

+46
-50
lines changed

src/type/__tests__/definition-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ describe('Type System: Scalars', () => {
4646
expect(() => new GraphQLScalarType({ name: 'SomeScalar' })).to.not.throw();
4747
});
4848

49-
it('accepts a Scalar type defining specifiedByUrl', () => {
49+
it('accepts a Scalar type defining specifiedBy', () => {
5050
expect(
5151
() =>
5252
new GraphQLScalarType({
5353
name: 'SomeScalar',
54-
specifiedByUrl: 'https://example.com/foo_spec',
54+
specifiedBy: 'https://example.com/foo_spec',
5555
}),
5656
).not.to.throw();
5757
});
@@ -139,16 +139,16 @@ describe('Type System: Scalars', () => {
139139
);
140140
});
141141

142-
it('rejects a Scalar type defining specifiedByUrl with an incorrect type', () => {
142+
it('rejects a Scalar type defining specifiedBy with an incorrect type', () => {
143143
expect(
144144
() =>
145145
new GraphQLScalarType({
146146
name: 'SomeScalar',
147147
// $FlowExpectedError[incompatible-call]
148-
specifiedByUrl: {},
148+
specifiedBy: {},
149149
}),
150150
).to.throw(
151-
'SomeScalar must provide "specifiedByUrl" as a string, but got: {}.',
151+
'SomeScalar must provide "specifiedBy" as a string, but got: {}.',
152152
);
153153
});
154154
});

src/type/__tests__/introspection-test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Introspection', () => {
3535
{
3636
kind: 'OBJECT',
3737
name: 'SomeObject',
38-
specifiedByUrl: null,
38+
specifiedBy: null,
3939
fields: [
4040
{
4141
name: 'someField',
@@ -57,7 +57,7 @@ describe('Introspection', () => {
5757
{
5858
kind: 'SCALAR',
5959
name: 'String',
60-
specifiedByUrl: null,
60+
specifiedBy: null,
6161
fields: null,
6262
inputFields: null,
6363
interfaces: null,
@@ -67,7 +67,7 @@ describe('Introspection', () => {
6767
{
6868
kind: 'SCALAR',
6969
name: 'Boolean',
70-
specifiedByUrl: null,
70+
specifiedBy: null,
7171
fields: null,
7272
inputFields: null,
7373
interfaces: null,
@@ -77,7 +77,7 @@ describe('Introspection', () => {
7777
{
7878
kind: 'OBJECT',
7979
name: '__Schema',
80-
specifiedByUrl: null,
80+
specifiedBy: null,
8181
fields: [
8282
{
8383
name: 'description',
@@ -182,7 +182,7 @@ describe('Introspection', () => {
182182
{
183183
kind: 'OBJECT',
184184
name: '__Type',
185-
specifiedByUrl: null,
185+
specifiedBy: null,
186186
fields: [
187187
{
188188
name: 'kind',
@@ -222,7 +222,7 @@ describe('Introspection', () => {
222222
deprecationReason: null,
223223
},
224224
{
225-
name: 'specifiedByUrl',
225+
name: 'specifiedBy',
226226
args: [],
227227
type: {
228228
kind: 'SCALAR',
@@ -377,7 +377,7 @@ describe('Introspection', () => {
377377
{
378378
kind: 'ENUM',
379379
name: '__TypeKind',
380-
specifiedByUrl: null,
380+
specifiedBy: null,
381381
fields: null,
382382
inputFields: null,
383383
interfaces: null,
@@ -428,7 +428,7 @@ describe('Introspection', () => {
428428
{
429429
kind: 'OBJECT',
430430
name: '__Field',
431-
specifiedByUrl: null,
431+
specifiedBy: null,
432432
fields: [
433433
{
434434
name: 'name',
@@ -539,7 +539,7 @@ describe('Introspection', () => {
539539
{
540540
kind: 'OBJECT',
541541
name: '__InputValue',
542-
specifiedByUrl: null,
542+
specifiedBy: null,
543543
fields: [
544544
{
545545
name: 'name',
@@ -628,7 +628,7 @@ describe('Introspection', () => {
628628
{
629629
kind: 'OBJECT',
630630
name: '__EnumValue',
631-
specifiedByUrl: null,
631+
specifiedBy: null,
632632
fields: [
633633
{
634634
name: 'name',
@@ -691,7 +691,7 @@ describe('Introspection', () => {
691691
{
692692
kind: 'OBJECT',
693693
name: '__Directive',
694-
specifiedByUrl: null,
694+
specifiedBy: null,
695695
fields: [
696696
{
697697
name: 'name',
@@ -789,7 +789,7 @@ describe('Introspection', () => {
789789
{
790790
kind: 'ENUM',
791791
name: '__DirectiveLocation',
792-
specifiedByUrl: null,
792+
specifiedBy: null,
793793
fields: null,
794794
inputFields: null,
795795
interfaces: null,
@@ -1560,7 +1560,7 @@ describe('Introspection', () => {
15601560
`);
15611561

15621562
const source = getIntrospectionQuery({
1563-
specifiedByUrl: true,
1563+
specifiedBy: true,
15641564
directiveIsRepeatable: true,
15651565
schemaDescription: true,
15661566
});

src/type/introspection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const __DirectiveLocation: GraphQLEnumType = new GraphQLEnumType({
196196
export const __Type: GraphQLObjectType = new GraphQLObjectType({
197197
name: '__Type',
198198
description:
199-
'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, description and optional `specifiedByUrl`, 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.',
199+
'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, description and optional `specifiedBy`, 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.',
200200
fields: () =>
201201
({
202202
kind: {
@@ -241,10 +241,10 @@ export const __Type: GraphQLObjectType = new GraphQLObjectType({
241241
resolve: (type) =>
242242
type.description !== undefined ? type.description : undefined,
243243
},
244-
specifiedByUrl: {
244+
specifiedBy: {
245245
type: GraphQLString,
246246
resolve: (obj) =>
247-
obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined,
247+
obj.specifiedBy !== undefined ? obj.specifiedBy : undefined,
248248
},
249249
fields: {
250250
type: new GraphQLList(new GraphQLNonNull(__Field)),

src/utilities/__tests__/buildASTSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ describe('Schema Builder', () => {
707707
const schema = buildSchema(sdl);
708708

709709
expect(schema.getType('Foo')).to.include({
710-
specifiedByUrl: 'https://example.com/foo_spec',
710+
specifiedBy: 'https://example.com/foo_spec',
711711
});
712712
});
713713

src/utilities/__tests__/extendSchema-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ describe('extendSchema', () => {
315315
const extendedSchema = extendSchema(schema, parse(extensionSDL));
316316
const foo = assertScalarType(extendedSchema.getType('Foo'));
317317

318-
expect(foo.specifiedByUrl).to.equal('https://example.com/foo_spec');
318+
expect(foo.specifiedBy).to.equal('https://example.com/foo_spec');
319319

320320
expect(validateSchema(extendedSchema)).to.deep.equal([]);
321321
expectExtensionASTNodes(foo).to.equal(extensionSDL);

src/utilities/__tests__/getIntrospectionQuery-test.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ describe('getIntrospectionQuery', () => {
6363
}).toNotMatch('description');
6464
});
6565

66-
it('include "specifiedByUrl" field', () => {
67-
expectIntrospectionQuery().toNotMatch('specifiedByUrl');
66+
it('include "specifiedBy" field', () => {
67+
expectIntrospectionQuery().toNotMatch('specifiedBy');
6868

69-
expectIntrospectionQuery({ specifiedByUrl: true }).toMatch(
70-
'specifiedByUrl',
71-
);
69+
expectIntrospectionQuery({ specifiedByUrl: true }).toMatch('specifiedBy');
7270

7371
expectIntrospectionQuery({ specifiedByUrl: false }).toNotMatch(
74-
'specifiedByUrl',
72+
'specifiedBy',
7573
);
7674
});
7775

src/utilities/__tests__/printSchema-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,10 @@ describe('Type System Printer', () => {
495495
`);
496496
});
497497

498-
it('Custom Scalar with specifiedByUrl', () => {
498+
it('Custom Scalar with specifiedBy', () => {
499499
const FooType = new GraphQLScalarType({
500500
name: 'Foo',
501-
specifiedByUrl: 'https://example.com/foo_spec',
501+
specifiedBy: 'https://example.com/foo_spec',
502502
});
503503

504504
const schema = new GraphQLSchema({ types: [FooType] });
@@ -670,13 +670,13 @@ describe('Type System Printer', () => {
670670
"""
671671
The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the \`__TypeKind\` enum.
672672
673-
Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional \`specifiedByUrl\`, 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.
673+
Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional \`specifiedBy\`, 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.
674674
"""
675675
type __Type {
676676
kind: __TypeKind!
677677
name: String
678678
description: String
679-
specifiedByUrl: String
679+
specifiedBy: String
680680
fields(includeDeprecated: Boolean = false): [__Field!]
681681
interfaces: [__Type!]
682682
possibleTypes: [__Type!]

src/utilities/buildClientSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function buildClientSchema(
201201
return new GraphQLScalarType({
202202
name: scalarIntrospection.name,
203203
description: scalarIntrospection.description,
204-
specifiedByUrl: scalarIntrospection.specifiedByUrl,
204+
specifiedBy: scalarIntrospection.specifiedBy,
205205
});
206206
}
207207

src/utilities/extendSchema.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ export function extendSchemaImpl(
310310
const config = type.toConfig();
311311
const extensions = typeExtensionsMap[config.name] ?? [];
312312

313-
let specifiedByUrl = config.specifiedByUrl;
313+
let specifiedBy = config.specifiedBy;
314314
for (const extensionNode of extensions) {
315-
specifiedByUrl = getSpecifiedByUrl(extensionNode) ?? specifiedByUrl;
315+
specifiedBy = getSpecifiedBy(extensionNode) ?? specifiedBy;
316316
}
317317

318318
return new GraphQLScalarType({
319319
...config,
320-
specifiedByUrl,
320+
specifiedBy,
321321
extensionASTNodes: config.extensionASTNodes.concat(extensions),
322322
});
323323
}
@@ -655,7 +655,7 @@ export function extendSchemaImpl(
655655
return new GraphQLScalarType({
656656
name,
657657
description: astNode.description?.value,
658-
specifiedByUrl: getSpecifiedByUrl(astNode),
658+
specifiedBy: getSpecifiedBy(astNode),
659659
astNode,
660660
extensionASTNodes,
661661
});
@@ -702,9 +702,9 @@ function getDeprecationReason(
702702
}
703703

704704
/**
705-
* Given a scalar node, returns the string value for the specifiedByUrl.
705+
* Given a scalar node, returns the string value for the specifiedBy.
706706
*/
707-
function getSpecifiedByUrl(
707+
function getSpecifiedBy(
708708
node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode,
709709
): ?string {
710710
const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node);

src/utilities/getIntrospectionQuery.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface IntrospectionOptions {
77
// Default: true
88
descriptions?: boolean;
99

10-
// Whether to include `specifiedByUrl` in the introspection result.
10+
// Whether to include `specifiedBy` in the introspection result.
1111
// Default: false
1212
specifiedByUrl?: boolean;
1313

@@ -67,7 +67,7 @@ export interface IntrospectionScalarType {
6767
readonly kind: 'SCALAR';
6868
readonly name: string;
6969
readonly description?: Maybe<string>;
70-
readonly specifiedByUrl?: Maybe<string>;
70+
readonly specifiedBy?: Maybe<string>;
7171
}
7272

7373
export interface IntrospectionObjectType {

0 commit comments

Comments
 (0)