Skip to content

Commit 688f93c

Browse files
isDeprecated: make required on GraphQLField/GraphQLEnumValue (#2469)
1 parent be654b5 commit 688f93c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/type/definition.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ export interface GraphQLField<
517517
args: Array<GraphQLArgument>;
518518
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
519519
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
520-
isDeprecated?: boolean;
520+
isDeprecated: boolean;
521521
deprecationReason?: Maybe<string>;
522522
extensions: Maybe<Readonly<Record<string, any>>>;
523523
astNode?: Maybe<FieldDefinitionNode>;
@@ -739,7 +739,7 @@ export interface GraphQLEnumValue {
739739
name: string;
740740
description: Maybe<string>;
741741
value: any;
742-
isDeprecated?: boolean;
742+
isDeprecated: boolean;
743743
deprecationReason: Maybe<string>;
744744
extensions: Maybe<Readonly<Record<string, any>>>;
745745
astNode?: Maybe<EnumValueDefinitionNode>;

src/type/definition.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ export type GraphQLField<
967967
args: Array<GraphQLArgument>,
968968
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>,
969969
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>,
970-
isDeprecated?: boolean,
970+
isDeprecated: boolean,
971971
deprecationReason: ?string,
972972
extensions: ?ReadOnlyObjMap<mixed>,
973973
astNode: ?FieldDefinitionNode,

src/type/introspection.js

+3
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ export const SchemaMetaFieldDef: GraphQLField<mixed, mixed> = {
457457
description: 'Access the current type schema of this server.',
458458
args: [],
459459
resolve: (_source, _args, _context, { schema }) => schema,
460+
isDeprecated: false,
460461
deprecationReason: undefined,
461462
extensions: undefined,
462463
astNode: undefined,
@@ -477,6 +478,7 @@ export const TypeMetaFieldDef: GraphQLField<mixed, mixed> = {
477478
},
478479
],
479480
resolve: (_source, { name }, _context, { schema }) => schema.getType(name),
481+
isDeprecated: false,
480482
deprecationReason: undefined,
481483
extensions: undefined,
482484
astNode: undefined,
@@ -488,6 +490,7 @@ export const TypeNameMetaFieldDef: GraphQLField<mixed, mixed> = {
488490
description: 'The name of the current Object type at runtime.',
489491
args: [],
490492
resolve: (_source, _args, _context, { parentType }) => parentType.name,
493+
isDeprecated: false,
491494
deprecationReason: undefined,
492495
extensions: undefined,
493496
astNode: undefined,

0 commit comments

Comments
 (0)