From f78ae917ae36bc62064698e7f0eae8fb14bcb8ea Mon Sep 17 00:00:00 2001 From: Jan Melcher Date: Wed, 21 Jun 2017 10:42:38 +0200 Subject: [PATCH] get[Mutation|Subscription]Type() are nullable According to [`schema.js`](https://github.com/graphql/graphql-js/blob/master/src/type/schema.js#L160), `GraphQLSchema.getMutationType()` and `getSubscriptionType()` may return `undefined`, so the types should reflect that. --- types/graphql/type/schema.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index 0f02cd78af..f4f4a99d58 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -49,8 +49,8 @@ export class GraphQLSchema { constructor(config: GraphQLSchemaConfig) getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType; - getSubscriptionType(): GraphQLObjectType; + getMutationType(): GraphQLObjectType|undefined; + getSubscriptionType(): GraphQLObjectType|undefined; getTypeMap(): { [typeName: string]: GraphQLNamedType }; getType(name: string): GraphQLType; getPossibleTypes(abstractType: GraphQLAbstractType): Array;