UNPKG

graphql-gene

Version:

Generates automatically an executable schema out of your ORM models

21 lines (20 loc) 850 B
import { BASIC_GRAPHQL_TYPES } from '../constants'; import { GraphQLFieldResolver, GraphQLScalarType } from 'graphql'; import { GeneSchema } from 'graphql-gene/schema'; import { GeneContext } from 'graphql-gene/context'; export type GraphQLVarType = 'type' | 'enum' | 'interface' | 'input' | 'scalar' | 'union'; export type GraphqlTypes = GeneSchema; export type GraphqlTypeName = keyof GraphqlTypes; export type BasicGraphqlType = `${BASIC_GRAPHQL_TYPES}`; export type ValidGraphqlType = GraphqlTypeName | BasicGraphqlType; export type FieldResolver = GraphQLFieldResolver<Record<string, unknown> | undefined, GeneContext>; export type Resolvers = { [type: string]: { [field: string]: FieldResolver; }; }; export type ResolversOrScalars = { [type: string]: { [field: string]: FieldResolver; } | GraphQLScalarType; };