Skip to content

isDeprecated: make required on GraphQLField/GraphQLEnumValue #2469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/type/definition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ export interface GraphQLField<
args: Array<GraphQLArgument>;
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>;
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>;
isDeprecated?: boolean;
isDeprecated: boolean;
deprecationReason?: Maybe<string>;
extensions: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<FieldDefinitionNode>;
Expand Down Expand Up @@ -739,7 +739,7 @@ export interface GraphQLEnumValue {
name: string;
description: Maybe<string>;
value: any;
isDeprecated?: boolean;
isDeprecated: boolean;
deprecationReason: Maybe<string>;
extensions: Maybe<Readonly<Record<string, any>>>;
astNode?: Maybe<EnumValueDefinitionNode>;
Expand Down
2 changes: 1 addition & 1 deletion src/type/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ export type GraphQLField<
args: Array<GraphQLArgument>,
resolve?: GraphQLFieldResolver<TSource, TContext, TArgs>,
subscribe?: GraphQLFieldResolver<TSource, TContext, TArgs>,
isDeprecated?: boolean,
isDeprecated: boolean,
deprecationReason: ?string,
extensions: ?ReadOnlyObjMap<mixed>,
astNode: ?FieldDefinitionNode,
Expand Down
3 changes: 3 additions & 0 deletions src/type/introspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ export const SchemaMetaFieldDef: GraphQLField<mixed, mixed> = {
description: 'Access the current type schema of this server.',
args: [],
resolve: (_source, _args, _context, { schema }) => schema,
isDeprecated: false,
deprecationReason: undefined,
extensions: undefined,
astNode: undefined,
Expand All @@ -477,6 +478,7 @@ export const TypeMetaFieldDef: GraphQLField<mixed, mixed> = {
},
],
resolve: (_source, { name }, _context, { schema }) => schema.getType(name),
isDeprecated: false,
deprecationReason: undefined,
extensions: undefined,
astNode: undefined,
Expand All @@ -488,6 +490,7 @@ export const TypeNameMetaFieldDef: GraphQLField<mixed, mixed> = {
description: 'The name of the current Object type at runtime.',
args: [],
resolve: (_source, _args, _context, { parentType }) => parentType.name,
isDeprecated: false,
deprecationReason: undefined,
extensions: undefined,
astNode: undefined,
Expand Down