// Copyright IBM Corp. 2018. All Rights Reserved. // Node module: openapi-to-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT /** * Custom type definitions for GraphQL. */ import { GraphQLObjectType, GraphQLScalarType, GraphQLInputObjectType, GraphQLList, GraphQLEnumType, GraphQLUnionType, GraphQLFieldResolver } from 'graphql' export enum GraphQLOperationType { Query, Mutation, Subscription } export type GraphQLType = | GraphQLObjectType | GraphQLInputObjectType | GraphQLList | GraphQLUnionType | GraphQLEnumType | GraphQLScalarType type Arg = { type: any description?: string } export type Args = { [key: string]: Arg } export type SubscriptionContext = { pubsub: any [key: string]: any } export type SubscriptionIterator = ( root: object, args: object, context: SubscriptionContext, info?: object ) => AsyncIterable export type Field = { type: GraphQLType resolve?: GraphQLFieldResolver subscribe?: GraphQLFieldResolver args?: Args description: string }