UNPKG

@gql2ts/util

Version:
13 lines (12 loc) 973 B
import { IntrospectionQuery, GraphQLSchema, GraphQLType, GraphQLNonNull, GraphQLList, GraphQLEnumType, GraphQLNamedType, GraphQLUnionType, GraphQLScalarType } from 'graphql'; export declare type PossibleIntrospectionInputs = { data: IntrospectionQuery; } | IntrospectionQuery; export declare type PossibleSchemaInput = GraphQLSchema | string | PossibleIntrospectionInputs; export declare function isIntrospectionResult(schema: PossibleIntrospectionInputs): schema is IntrospectionQuery; export declare const schemaFromInputs: (schema: PossibleSchemaInput) => GraphQLSchema; export declare function isNonNullable(type: GraphQLType): type is GraphQLNonNull<any>; export declare function isList(type: GraphQLType): type is GraphQLList<any>; export declare function isEnum(type: GraphQLType): type is GraphQLEnumType; export declare function isUnion(type: GraphQLNamedType): type is GraphQLUnionType; export declare function isScalar(type: any): type is GraphQLScalarType;