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.
This commit is contained in:
Jan Melcher
2017-06-21 10:42:38 +02:00
committed by GitHub
parent a3af39ba43
commit f78ae917ae

View File

@@ -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<GraphQLObjectType>;