add isNamedType & assertNamedType.

promisify isTypeOf and resolveType.
This commit is contained in:
Firede
2017-03-27 19:00:26 +08:00
parent ad9c5dd1d2
commit 6843699843
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for graphql v0.8.2
// Type definitions for graphql v0.9.1
// Project: https://www.npmjs.com/package/graphql
// Definitions by: TonyYang <https://github.com/TonyPythoneer>, Caleb Meredith <https://github.com/calebmer>, Dominic Watson <https://github.com/intellix>, Firede <https://github.com/firede>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+6 -2
View File
@@ -126,6 +126,10 @@ export type GraphQLNamedType =
GraphQLEnumType |
GraphQLInputObjectType;
export function isNamedType(type: GraphQLType): boolean;
export function assertNamedType(type: GraphQLType): GraphQLNamedType;
export function getNamedType(type: GraphQLType): GraphQLNamedType;
/**
@@ -237,13 +241,13 @@ export type GraphQLTypeResolver<TSource, TContext> = (
value: TSource,
context: TContext,
info: GraphQLResolveInfo
) => GraphQLObjectType;
) => GraphQLObjectType | string | Promise<GraphQLObjectType | string>;
export type GraphQLIsTypeOfFn<TSource, TContext> = (
source: TSource,
context: TContext,
info: GraphQLResolveInfo
) => boolean;
) => boolean | Promise<boolean>;
export type GraphQLFieldResolver<TSource, TContext> = (
source: TSource,