Initialisation
Added the packages and files for the backend server
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* ES6 Map with additional `add` method to accumulate items.
|
||||
*/
|
||||
export declare class AccumulatorMap<K, T> extends Map<K, Array<T>> {
|
||||
get [Symbol.toStringTag](): string;
|
||||
add(key: K, item: T): void;
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* ES6 Map with additional `add` method to accumulate items.
|
||||
*/
|
||||
export declare class AccumulatorMap<K, T> extends Map<K, Array<T>> {
|
||||
get [Symbol.toStringTag](): string;
|
||||
add(key: K, item: T): void;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface AggregateError extends Error {
|
||||
errors: any[];
|
||||
}
|
||||
interface AggregateErrorConstructor {
|
||||
new (errors: Iterable<any>, message?: string): AggregateError;
|
||||
(errors: Iterable<any>, message?: string): AggregateError;
|
||||
readonly prototype: AggregateError;
|
||||
}
|
||||
declare let AggregateErrorImpl: AggregateErrorConstructor;
|
||||
export { AggregateErrorImpl as AggregateError };
|
||||
export declare function isAggregateError(error: Error): error is AggregateError;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface AggregateError extends Error {
|
||||
errors: any[];
|
||||
}
|
||||
interface AggregateErrorConstructor {
|
||||
new (errors: Iterable<any>, message?: string): AggregateError;
|
||||
(errors: Iterable<any>, message?: string): AggregateError;
|
||||
readonly prototype: AggregateError;
|
||||
}
|
||||
declare let AggregateErrorImpl: AggregateErrorConstructor;
|
||||
export { AggregateErrorImpl as AggregateError };
|
||||
export declare function isAggregateError(error: Error): error is AggregateError;
|
||||
+257
@@ -0,0 +1,257 @@
|
||||
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
||||
import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLResolveInfo, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLDirective, FragmentDefinitionNode, SelectionNode, GraphQLOutputType, FieldDefinitionNode, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLArgumentConfig, GraphQLEnumValueConfig, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, GraphQLIsTypeOfFn, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, InterfaceTypeDefinitionNode, GraphQLTypeResolver, UnionTypeDefinitionNode, UnionTypeExtensionNode, InputObjectTypeExtensionNode, InputObjectTypeDefinitionNode, GraphQLType, Source, DefinitionNode, OperationTypeNode, GraphQLError } from 'graphql';
|
||||
/**
|
||||
* The result of GraphQL execution.
|
||||
*
|
||||
* - `errors` is included when any errors occurred as a non-empty array.
|
||||
* - `data` is the result of a successful execution of the query.
|
||||
* - `hasNext` is true if a future payload is expected.
|
||||
* - `extensions` is reserved for adding non-standard properties.
|
||||
*/
|
||||
export interface ExecutionResult<TData = any, TExtensions = any> {
|
||||
incremental?: ReadonlyArray<ExecutionResult<TData, TExtensions>>;
|
||||
data?: TData | null;
|
||||
errors?: ReadonlyArray<GraphQLError>;
|
||||
hasNext?: boolean;
|
||||
extensions?: TExtensions;
|
||||
label?: string;
|
||||
path?: ReadonlyArray<string | number>;
|
||||
items?: TData | null;
|
||||
}
|
||||
export interface ExecutionRequest<TVariables extends Record<string, any> = any, TContext = any, TRootValue = any, TExtensions = Record<string, any>, TReturn = any> {
|
||||
document: TypedDocumentNode<TReturn, TVariables>;
|
||||
variables?: TVariables;
|
||||
operationType?: OperationTypeNode;
|
||||
operationName?: string;
|
||||
extensions?: TExtensions;
|
||||
rootValue?: TRootValue;
|
||||
context?: TContext;
|
||||
info?: GraphQLResolveInfo;
|
||||
}
|
||||
export interface GraphQLParseOptions {
|
||||
noLocation?: boolean;
|
||||
allowLegacySDLEmptyFields?: boolean;
|
||||
allowLegacySDLImplementsInterfaces?: boolean;
|
||||
experimentalFragmentVariables?: boolean;
|
||||
/**
|
||||
* Set to `true` in order to convert all GraphQL comments (marked with # sign) to descriptions (""")
|
||||
* GraphQL has built-in support for transforming descriptions to comments (with `print`), but not while
|
||||
* parsing. Turning the flag on will support the other way as well (`parse`)
|
||||
*/
|
||||
commentDescriptions?: boolean;
|
||||
}
|
||||
export type ValidatorBehavior = 'error' | 'warn' | 'ignore';
|
||||
/**
|
||||
* Options for validating resolvers
|
||||
*/
|
||||
export interface IResolverValidationOptions {
|
||||
/**
|
||||
* Enable to require a resolver to be defined for any field that has
|
||||
* arguments. Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForArgs?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require a resolver to be defined for any field which has
|
||||
* a return type that isn't a scalar. Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForNonScalar?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require a resolver for be defined for all fields defined
|
||||
* in the schema. Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForAllFields?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require a `resolveType()` for Interface and Union types.
|
||||
* Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForResolveType?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require all defined resolvers to match fields that
|
||||
* actually exist in the schema. Defaults to `error` to catch common errors.
|
||||
*/
|
||||
requireResolversToMatchSchema?: ValidatorBehavior;
|
||||
}
|
||||
/**
|
||||
* Configuration object for adding resolvers to a schema
|
||||
*/
|
||||
export interface IAddResolversToSchemaOptions {
|
||||
/**
|
||||
* The schema to which to add resolvers
|
||||
*/
|
||||
schema: GraphQLSchema;
|
||||
/**
|
||||
* Object describing the field resolvers to add to the provided schema
|
||||
*/
|
||||
resolvers: IResolvers;
|
||||
/**
|
||||
* Override the default field resolver provided by `graphql-js`
|
||||
*/
|
||||
defaultFieldResolver?: IFieldResolver<any, any>;
|
||||
/**
|
||||
* Additional options for validating the provided resolvers
|
||||
*/
|
||||
resolverValidationOptions?: IResolverValidationOptions;
|
||||
/**
|
||||
* GraphQL object types that implement interfaces will inherit any missing
|
||||
* resolvers from their interface types defined in the `resolvers` object
|
||||
*/
|
||||
inheritResolversFromInterfaces?: boolean;
|
||||
/**
|
||||
* Set to `true` to modify the existing schema instead of creating a new one
|
||||
*/
|
||||
updateResolversInPlace?: boolean;
|
||||
}
|
||||
export type IScalarTypeResolver = GraphQLScalarType & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__serialize?: GraphQLScalarSerializer<any>;
|
||||
__parseValue?: GraphQLScalarValueParser<any>;
|
||||
__parseLiteral?: GraphQLScalarLiteralParser<any>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: ScalarTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<ScalarTypeExtensionNode>;
|
||||
};
|
||||
export type IEnumTypeResolver = Record<string, any> & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: EnumTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<EnumTypeExtensionNode>;
|
||||
};
|
||||
export interface IFieldResolverOptions<TSource = any, TContext = any, TArgs = any> {
|
||||
name?: string;
|
||||
description?: string;
|
||||
type?: GraphQLOutputType;
|
||||
args?: Array<GraphQLArgument>;
|
||||
resolve?: IFieldResolver<TSource, TContext, TArgs>;
|
||||
subscribe?: IFieldResolver<TSource, TContext, TArgs>;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason?: string;
|
||||
extensions?: Record<string, any>;
|
||||
astNode?: FieldDefinitionNode;
|
||||
}
|
||||
export type FieldNodeMapper = (fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | Array<SelectionNode>;
|
||||
export type FieldNodeMappers = Record<string, Record<string, FieldNodeMapper>>;
|
||||
export type InputFieldFilter = (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean;
|
||||
export type FieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean;
|
||||
export type ObjectFieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
|
||||
export type RootFieldFilter = (operation: 'Query' | 'Mutation' | 'Subscription', rootFieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
|
||||
export type TypeFilter = (typeName: string, type: GraphQLType) => boolean;
|
||||
export type ArgumentFilter = (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean;
|
||||
export type RenameTypesOptions = {
|
||||
renameBuiltins: boolean;
|
||||
renameScalars: boolean;
|
||||
};
|
||||
export type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn;
|
||||
export type TypeSource = string | Source | DocumentNode | GraphQLSchema | DefinitionNode | Array<TypeSource> | (() => TypeSource);
|
||||
export type IObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
||||
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
||||
} & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: ObjectTypeDefinitionNode;
|
||||
__extensionASTNodes?: ObjectTypeExtensionNode;
|
||||
};
|
||||
export type IInterfaceTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
||||
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
||||
} & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__resolveType?: GraphQLTypeResolver<any, any>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: InterfaceTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<InterfaceTypeExtensionNode>;
|
||||
};
|
||||
export type IUnionTypeResolver = {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__resolveType?: GraphQLTypeResolver<any, any>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: UnionTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<UnionTypeExtensionNode>;
|
||||
};
|
||||
export type IInputObjectTypeResolver = {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: InputObjectTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<InputObjectTypeExtensionNode>;
|
||||
};
|
||||
export type ISchemaLevelResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = IFieldResolver<TSource, TContext, TArgs, TReturn>;
|
||||
export type IResolvers<TSource = any, TContext = any, TArgs = Record<string, any>, TReturn = any> = Record<string, ISchemaLevelResolver<TSource, TContext, TArgs, TReturn> | IObjectTypeResolver<TSource, TContext> | IInterfaceTypeResolver<TSource, TContext> | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>;
|
||||
export type IFieldIteratorFn = (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void;
|
||||
export type IDefaultValueIteratorFn = (type: GraphQLInputType, value: any) => void;
|
||||
export type NextResolverFn = () => Promise<any>;
|
||||
export type VisitableSchemaType = GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField<any, any> | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue;
|
||||
export declare enum MapperKind {
|
||||
TYPE = "MapperKind.TYPE",
|
||||
SCALAR_TYPE = "MapperKind.SCALAR_TYPE",
|
||||
ENUM_TYPE = "MapperKind.ENUM_TYPE",
|
||||
COMPOSITE_TYPE = "MapperKind.COMPOSITE_TYPE",
|
||||
OBJECT_TYPE = "MapperKind.OBJECT_TYPE",
|
||||
INPUT_OBJECT_TYPE = "MapperKind.INPUT_OBJECT_TYPE",
|
||||
ABSTRACT_TYPE = "MapperKind.ABSTRACT_TYPE",
|
||||
UNION_TYPE = "MapperKind.UNION_TYPE",
|
||||
INTERFACE_TYPE = "MapperKind.INTERFACE_TYPE",
|
||||
ROOT_OBJECT = "MapperKind.ROOT_OBJECT",
|
||||
QUERY = "MapperKind.QUERY",
|
||||
MUTATION = "MapperKind.MUTATION",
|
||||
SUBSCRIPTION = "MapperKind.SUBSCRIPTION",
|
||||
DIRECTIVE = "MapperKind.DIRECTIVE",
|
||||
FIELD = "MapperKind.FIELD",
|
||||
COMPOSITE_FIELD = "MapperKind.COMPOSITE_FIELD",
|
||||
OBJECT_FIELD = "MapperKind.OBJECT_FIELD",
|
||||
ROOT_FIELD = "MapperKind.ROOT_FIELD",
|
||||
QUERY_ROOT_FIELD = "MapperKind.QUERY_ROOT_FIELD",
|
||||
MUTATION_ROOT_FIELD = "MapperKind.MUTATION_ROOT_FIELD",
|
||||
SUBSCRIPTION_ROOT_FIELD = "MapperKind.SUBSCRIPTION_ROOT_FIELD",
|
||||
INTERFACE_FIELD = "MapperKind.INTERFACE_FIELD",
|
||||
INPUT_OBJECT_FIELD = "MapperKind.INPUT_OBJECT_FIELD",
|
||||
ARGUMENT = "MapperKind.ARGUMENT",
|
||||
ENUM_VALUE = "MapperKind.ENUM_VALUE"
|
||||
}
|
||||
export interface SchemaMapper {
|
||||
[MapperKind.TYPE]?: NamedTypeMapper;
|
||||
[MapperKind.SCALAR_TYPE]?: ScalarTypeMapper;
|
||||
[MapperKind.ENUM_TYPE]?: EnumTypeMapper;
|
||||
[MapperKind.COMPOSITE_TYPE]?: CompositeTypeMapper;
|
||||
[MapperKind.OBJECT_TYPE]?: ObjectTypeMapper;
|
||||
[MapperKind.INPUT_OBJECT_TYPE]?: InputObjectTypeMapper;
|
||||
[MapperKind.ABSTRACT_TYPE]?: AbstractTypeMapper;
|
||||
[MapperKind.UNION_TYPE]?: UnionTypeMapper;
|
||||
[MapperKind.INTERFACE_TYPE]?: InterfaceTypeMapper;
|
||||
[MapperKind.ROOT_OBJECT]?: ObjectTypeMapper;
|
||||
[MapperKind.QUERY]?: ObjectTypeMapper;
|
||||
[MapperKind.MUTATION]?: ObjectTypeMapper;
|
||||
[MapperKind.SUBSCRIPTION]?: ObjectTypeMapper;
|
||||
[MapperKind.ENUM_VALUE]?: EnumValueMapper;
|
||||
[MapperKind.FIELD]?: GenericFieldMapper<GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig>;
|
||||
[MapperKind.OBJECT_FIELD]?: FieldMapper;
|
||||
[MapperKind.ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.QUERY_ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.MUTATION_ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.SUBSCRIPTION_ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.INTERFACE_FIELD]?: FieldMapper;
|
||||
[MapperKind.COMPOSITE_FIELD]?: FieldMapper;
|
||||
[MapperKind.ARGUMENT]?: ArgumentMapper;
|
||||
[MapperKind.INPUT_OBJECT_FIELD]?: InputFieldMapper;
|
||||
[MapperKind.DIRECTIVE]?: DirectiveMapper;
|
||||
}
|
||||
export type SchemaFieldMapperTypes = Array<MapperKind.FIELD | MapperKind.COMPOSITE_FIELD | MapperKind.OBJECT_FIELD | MapperKind.ROOT_FIELD | MapperKind.QUERY_ROOT_FIELD | MapperKind.MUTATION_ROOT_FIELD | MapperKind.SUBSCRIPTION_ROOT_FIELD | MapperKind.INTERFACE_FIELD | MapperKind.INPUT_OBJECT_FIELD>;
|
||||
export type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined;
|
||||
export type ScalarTypeMapper = (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined;
|
||||
export type EnumTypeMapper = (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined;
|
||||
export type EnumValueMapper = (valueConfig: GraphQLEnumValueConfig, typeName: string, schema: GraphQLSchema, externalValue: string) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined;
|
||||
export type CompositeTypeMapper = (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined;
|
||||
export type ObjectTypeMapper = (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined;
|
||||
export type InputObjectTypeMapper = (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined;
|
||||
export type AbstractTypeMapper = (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined;
|
||||
export type UnionTypeMapper = (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined;
|
||||
export type InterfaceTypeMapper = (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined;
|
||||
export type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined;
|
||||
export type GenericFieldMapper<F extends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig> = (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined;
|
||||
export type FieldMapper = GenericFieldMapper<GraphQLFieldConfig<any, any>>;
|
||||
export type ArgumentMapper = (argumentConfig: GraphQLArgumentConfig, fieldName: string, typeName: string, schema: GraphQLSchema) => GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined;
|
||||
export type InputFieldMapper = GenericFieldMapper<GraphQLInputFieldConfig>;
|
||||
+257
@@ -0,0 +1,257 @@
|
||||
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
||||
import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLResolveInfo, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLDirective, FragmentDefinitionNode, SelectionNode, GraphQLOutputType, FieldDefinitionNode, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLArgumentConfig, GraphQLEnumValueConfig, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, GraphQLIsTypeOfFn, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, InterfaceTypeDefinitionNode, GraphQLTypeResolver, UnionTypeDefinitionNode, UnionTypeExtensionNode, InputObjectTypeExtensionNode, InputObjectTypeDefinitionNode, GraphQLType, Source, DefinitionNode, OperationTypeNode, GraphQLError } from 'graphql';
|
||||
/**
|
||||
* The result of GraphQL execution.
|
||||
*
|
||||
* - `errors` is included when any errors occurred as a non-empty array.
|
||||
* - `data` is the result of a successful execution of the query.
|
||||
* - `hasNext` is true if a future payload is expected.
|
||||
* - `extensions` is reserved for adding non-standard properties.
|
||||
*/
|
||||
export interface ExecutionResult<TData = any, TExtensions = any> {
|
||||
incremental?: ReadonlyArray<ExecutionResult<TData, TExtensions>>;
|
||||
data?: TData | null;
|
||||
errors?: ReadonlyArray<GraphQLError>;
|
||||
hasNext?: boolean;
|
||||
extensions?: TExtensions;
|
||||
label?: string;
|
||||
path?: ReadonlyArray<string | number>;
|
||||
items?: TData | null;
|
||||
}
|
||||
export interface ExecutionRequest<TVariables extends Record<string, any> = any, TContext = any, TRootValue = any, TExtensions = Record<string, any>, TReturn = any> {
|
||||
document: TypedDocumentNode<TReturn, TVariables>;
|
||||
variables?: TVariables;
|
||||
operationType?: OperationTypeNode;
|
||||
operationName?: string;
|
||||
extensions?: TExtensions;
|
||||
rootValue?: TRootValue;
|
||||
context?: TContext;
|
||||
info?: GraphQLResolveInfo;
|
||||
}
|
||||
export interface GraphQLParseOptions {
|
||||
noLocation?: boolean;
|
||||
allowLegacySDLEmptyFields?: boolean;
|
||||
allowLegacySDLImplementsInterfaces?: boolean;
|
||||
experimentalFragmentVariables?: boolean;
|
||||
/**
|
||||
* Set to `true` in order to convert all GraphQL comments (marked with # sign) to descriptions (""")
|
||||
* GraphQL has built-in support for transforming descriptions to comments (with `print`), but not while
|
||||
* parsing. Turning the flag on will support the other way as well (`parse`)
|
||||
*/
|
||||
commentDescriptions?: boolean;
|
||||
}
|
||||
export type ValidatorBehavior = 'error' | 'warn' | 'ignore';
|
||||
/**
|
||||
* Options for validating resolvers
|
||||
*/
|
||||
export interface IResolverValidationOptions {
|
||||
/**
|
||||
* Enable to require a resolver to be defined for any field that has
|
||||
* arguments. Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForArgs?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require a resolver to be defined for any field which has
|
||||
* a return type that isn't a scalar. Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForNonScalar?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require a resolver for be defined for all fields defined
|
||||
* in the schema. Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForAllFields?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require a `resolveType()` for Interface and Union types.
|
||||
* Defaults to `ignore`.
|
||||
*/
|
||||
requireResolversForResolveType?: ValidatorBehavior;
|
||||
/**
|
||||
* Enable to require all defined resolvers to match fields that
|
||||
* actually exist in the schema. Defaults to `error` to catch common errors.
|
||||
*/
|
||||
requireResolversToMatchSchema?: ValidatorBehavior;
|
||||
}
|
||||
/**
|
||||
* Configuration object for adding resolvers to a schema
|
||||
*/
|
||||
export interface IAddResolversToSchemaOptions {
|
||||
/**
|
||||
* The schema to which to add resolvers
|
||||
*/
|
||||
schema: GraphQLSchema;
|
||||
/**
|
||||
* Object describing the field resolvers to add to the provided schema
|
||||
*/
|
||||
resolvers: IResolvers;
|
||||
/**
|
||||
* Override the default field resolver provided by `graphql-js`
|
||||
*/
|
||||
defaultFieldResolver?: IFieldResolver<any, any>;
|
||||
/**
|
||||
* Additional options for validating the provided resolvers
|
||||
*/
|
||||
resolverValidationOptions?: IResolverValidationOptions;
|
||||
/**
|
||||
* GraphQL object types that implement interfaces will inherit any missing
|
||||
* resolvers from their interface types defined in the `resolvers` object
|
||||
*/
|
||||
inheritResolversFromInterfaces?: boolean;
|
||||
/**
|
||||
* Set to `true` to modify the existing schema instead of creating a new one
|
||||
*/
|
||||
updateResolversInPlace?: boolean;
|
||||
}
|
||||
export type IScalarTypeResolver = GraphQLScalarType & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__serialize?: GraphQLScalarSerializer<any>;
|
||||
__parseValue?: GraphQLScalarValueParser<any>;
|
||||
__parseLiteral?: GraphQLScalarLiteralParser<any>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: ScalarTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<ScalarTypeExtensionNode>;
|
||||
};
|
||||
export type IEnumTypeResolver = Record<string, any> & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: EnumTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<EnumTypeExtensionNode>;
|
||||
};
|
||||
export interface IFieldResolverOptions<TSource = any, TContext = any, TArgs = any> {
|
||||
name?: string;
|
||||
description?: string;
|
||||
type?: GraphQLOutputType;
|
||||
args?: Array<GraphQLArgument>;
|
||||
resolve?: IFieldResolver<TSource, TContext, TArgs>;
|
||||
subscribe?: IFieldResolver<TSource, TContext, TArgs>;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason?: string;
|
||||
extensions?: Record<string, any>;
|
||||
astNode?: FieldDefinitionNode;
|
||||
}
|
||||
export type FieldNodeMapper = (fieldNode: FieldNode, fragments: Record<string, FragmentDefinitionNode>, transformationContext: Record<string, any>) => SelectionNode | Array<SelectionNode>;
|
||||
export type FieldNodeMappers = Record<string, Record<string, FieldNodeMapper>>;
|
||||
export type InputFieldFilter = (typeName?: string, fieldName?: string, inputFieldConfig?: GraphQLInputFieldConfig) => boolean;
|
||||
export type FieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig) => boolean;
|
||||
export type ObjectFieldFilter = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
|
||||
export type RootFieldFilter = (operation: 'Query' | 'Mutation' | 'Subscription', rootFieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => boolean;
|
||||
export type TypeFilter = (typeName: string, type: GraphQLType) => boolean;
|
||||
export type ArgumentFilter = (typeName?: string, fieldName?: string, argName?: string, argConfig?: GraphQLArgumentConfig) => boolean;
|
||||
export type RenameTypesOptions = {
|
||||
renameBuiltins: boolean;
|
||||
renameScalars: boolean;
|
||||
};
|
||||
export type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn;
|
||||
export type TypeSource = string | Source | DocumentNode | GraphQLSchema | DefinitionNode | Array<TypeSource> | (() => TypeSource);
|
||||
export type IObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
||||
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
||||
} & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__isTypeOf?: GraphQLIsTypeOfFn<TSource, TContext>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: ObjectTypeDefinitionNode;
|
||||
__extensionASTNodes?: ObjectTypeExtensionNode;
|
||||
};
|
||||
export type IInterfaceTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
||||
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
||||
} & {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__resolveType?: GraphQLTypeResolver<any, any>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: InterfaceTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<InterfaceTypeExtensionNode>;
|
||||
};
|
||||
export type IUnionTypeResolver = {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__resolveType?: GraphQLTypeResolver<any, any>;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: UnionTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<UnionTypeExtensionNode>;
|
||||
};
|
||||
export type IInputObjectTypeResolver = {
|
||||
__name?: string;
|
||||
__description?: string;
|
||||
__extensions?: Record<string, any>;
|
||||
__astNode?: InputObjectTypeDefinitionNode;
|
||||
__extensionASTNodes?: Array<InputObjectTypeExtensionNode>;
|
||||
};
|
||||
export type ISchemaLevelResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = IFieldResolver<TSource, TContext, TArgs, TReturn>;
|
||||
export type IResolvers<TSource = any, TContext = any, TArgs = Record<string, any>, TReturn = any> = Record<string, ISchemaLevelResolver<TSource, TContext, TArgs, TReturn> | IObjectTypeResolver<TSource, TContext> | IInterfaceTypeResolver<TSource, TContext> | IUnionTypeResolver | IScalarTypeResolver | IEnumTypeResolver | IInputObjectTypeResolver>;
|
||||
export type IFieldIteratorFn = (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void;
|
||||
export type IDefaultValueIteratorFn = (type: GraphQLInputType, value: any) => void;
|
||||
export type NextResolverFn = () => Promise<any>;
|
||||
export type VisitableSchemaType = GraphQLSchema | GraphQLObjectType | GraphQLInterfaceType | GraphQLInputObjectType | GraphQLNamedType | GraphQLScalarType | GraphQLField<any, any> | GraphQLInputField | GraphQLArgument | GraphQLUnionType | GraphQLEnumType | GraphQLEnumValue;
|
||||
export declare enum MapperKind {
|
||||
TYPE = "MapperKind.TYPE",
|
||||
SCALAR_TYPE = "MapperKind.SCALAR_TYPE",
|
||||
ENUM_TYPE = "MapperKind.ENUM_TYPE",
|
||||
COMPOSITE_TYPE = "MapperKind.COMPOSITE_TYPE",
|
||||
OBJECT_TYPE = "MapperKind.OBJECT_TYPE",
|
||||
INPUT_OBJECT_TYPE = "MapperKind.INPUT_OBJECT_TYPE",
|
||||
ABSTRACT_TYPE = "MapperKind.ABSTRACT_TYPE",
|
||||
UNION_TYPE = "MapperKind.UNION_TYPE",
|
||||
INTERFACE_TYPE = "MapperKind.INTERFACE_TYPE",
|
||||
ROOT_OBJECT = "MapperKind.ROOT_OBJECT",
|
||||
QUERY = "MapperKind.QUERY",
|
||||
MUTATION = "MapperKind.MUTATION",
|
||||
SUBSCRIPTION = "MapperKind.SUBSCRIPTION",
|
||||
DIRECTIVE = "MapperKind.DIRECTIVE",
|
||||
FIELD = "MapperKind.FIELD",
|
||||
COMPOSITE_FIELD = "MapperKind.COMPOSITE_FIELD",
|
||||
OBJECT_FIELD = "MapperKind.OBJECT_FIELD",
|
||||
ROOT_FIELD = "MapperKind.ROOT_FIELD",
|
||||
QUERY_ROOT_FIELD = "MapperKind.QUERY_ROOT_FIELD",
|
||||
MUTATION_ROOT_FIELD = "MapperKind.MUTATION_ROOT_FIELD",
|
||||
SUBSCRIPTION_ROOT_FIELD = "MapperKind.SUBSCRIPTION_ROOT_FIELD",
|
||||
INTERFACE_FIELD = "MapperKind.INTERFACE_FIELD",
|
||||
INPUT_OBJECT_FIELD = "MapperKind.INPUT_OBJECT_FIELD",
|
||||
ARGUMENT = "MapperKind.ARGUMENT",
|
||||
ENUM_VALUE = "MapperKind.ENUM_VALUE"
|
||||
}
|
||||
export interface SchemaMapper {
|
||||
[MapperKind.TYPE]?: NamedTypeMapper;
|
||||
[MapperKind.SCALAR_TYPE]?: ScalarTypeMapper;
|
||||
[MapperKind.ENUM_TYPE]?: EnumTypeMapper;
|
||||
[MapperKind.COMPOSITE_TYPE]?: CompositeTypeMapper;
|
||||
[MapperKind.OBJECT_TYPE]?: ObjectTypeMapper;
|
||||
[MapperKind.INPUT_OBJECT_TYPE]?: InputObjectTypeMapper;
|
||||
[MapperKind.ABSTRACT_TYPE]?: AbstractTypeMapper;
|
||||
[MapperKind.UNION_TYPE]?: UnionTypeMapper;
|
||||
[MapperKind.INTERFACE_TYPE]?: InterfaceTypeMapper;
|
||||
[MapperKind.ROOT_OBJECT]?: ObjectTypeMapper;
|
||||
[MapperKind.QUERY]?: ObjectTypeMapper;
|
||||
[MapperKind.MUTATION]?: ObjectTypeMapper;
|
||||
[MapperKind.SUBSCRIPTION]?: ObjectTypeMapper;
|
||||
[MapperKind.ENUM_VALUE]?: EnumValueMapper;
|
||||
[MapperKind.FIELD]?: GenericFieldMapper<GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig>;
|
||||
[MapperKind.OBJECT_FIELD]?: FieldMapper;
|
||||
[MapperKind.ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.QUERY_ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.MUTATION_ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.SUBSCRIPTION_ROOT_FIELD]?: FieldMapper;
|
||||
[MapperKind.INTERFACE_FIELD]?: FieldMapper;
|
||||
[MapperKind.COMPOSITE_FIELD]?: FieldMapper;
|
||||
[MapperKind.ARGUMENT]?: ArgumentMapper;
|
||||
[MapperKind.INPUT_OBJECT_FIELD]?: InputFieldMapper;
|
||||
[MapperKind.DIRECTIVE]?: DirectiveMapper;
|
||||
}
|
||||
export type SchemaFieldMapperTypes = Array<MapperKind.FIELD | MapperKind.COMPOSITE_FIELD | MapperKind.OBJECT_FIELD | MapperKind.ROOT_FIELD | MapperKind.QUERY_ROOT_FIELD | MapperKind.MUTATION_ROOT_FIELD | MapperKind.SUBSCRIPTION_ROOT_FIELD | MapperKind.INTERFACE_FIELD | MapperKind.INPUT_OBJECT_FIELD>;
|
||||
export type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined;
|
||||
export type ScalarTypeMapper = (type: GraphQLScalarType, schema: GraphQLSchema) => GraphQLScalarType | null | undefined;
|
||||
export type EnumTypeMapper = (type: GraphQLEnumType, schema: GraphQLSchema) => GraphQLEnumType | null | undefined;
|
||||
export type EnumValueMapper = (valueConfig: GraphQLEnumValueConfig, typeName: string, schema: GraphQLSchema, externalValue: string) => GraphQLEnumValueConfig | [string, GraphQLEnumValueConfig] | null | undefined;
|
||||
export type CompositeTypeMapper = (type: GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | null | undefined;
|
||||
export type ObjectTypeMapper = (type: GraphQLObjectType, schema: GraphQLSchema) => GraphQLObjectType | null | undefined;
|
||||
export type InputObjectTypeMapper = (type: GraphQLInputObjectType, schema: GraphQLSchema) => GraphQLInputObjectType | null | undefined;
|
||||
export type AbstractTypeMapper = (type: GraphQLInterfaceType | GraphQLUnionType, schema: GraphQLSchema) => GraphQLInterfaceType | GraphQLUnionType | null | undefined;
|
||||
export type UnionTypeMapper = (type: GraphQLUnionType, schema: GraphQLSchema) => GraphQLUnionType | null | undefined;
|
||||
export type InterfaceTypeMapper = (type: GraphQLInterfaceType, schema: GraphQLSchema) => GraphQLInterfaceType | null | undefined;
|
||||
export type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined;
|
||||
export type GenericFieldMapper<F extends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig> = (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined;
|
||||
export type FieldMapper = GenericFieldMapper<GraphQLFieldConfig<any, any>>;
|
||||
export type ArgumentMapper = (argumentConfig: GraphQLArgumentConfig, fieldName: string, typeName: string, schema: GraphQLSchema) => GraphQLArgumentConfig | [string, GraphQLArgumentConfig] | null | undefined;
|
||||
export type InputFieldMapper = GenericFieldMapper<GraphQLInputFieldConfig>;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { Maybe } from './types.cjs';
|
||||
export interface Path {
|
||||
readonly prev: Path | undefined;
|
||||
readonly key: string | number;
|
||||
readonly typename: string | undefined;
|
||||
}
|
||||
/**
|
||||
* Given a Path and a key, return a new Path containing the new key.
|
||||
*/
|
||||
export declare function addPath(prev: Readonly<Path> | undefined, key: string | number, typename: string | undefined): Path;
|
||||
/**
|
||||
* Given a Path, return an Array of the path keys.
|
||||
*/
|
||||
export declare function pathToArray(path: Maybe<Readonly<Path>>): Array<string | number>;
|
||||
/**
|
||||
* Build a string describing the path.
|
||||
*/
|
||||
export declare function printPathArray(path: ReadonlyArray<string | number>): string;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { Maybe } from './types.js';
|
||||
export interface Path {
|
||||
readonly prev: Path | undefined;
|
||||
readonly key: string | number;
|
||||
readonly typename: string | undefined;
|
||||
}
|
||||
/**
|
||||
* Given a Path and a key, return a new Path containing the new key.
|
||||
*/
|
||||
export declare function addPath(prev: Readonly<Path> | undefined, key: string | number, typename: string | undefined): Path;
|
||||
/**
|
||||
* Given a Path, return an Array of the path keys.
|
||||
*/
|
||||
export declare function pathToArray(path: Maybe<Readonly<Path>>): Array<string | number>;
|
||||
/**
|
||||
* Build a string describing the path.
|
||||
*/
|
||||
export declare function printPathArray(path: ReadonlyArray<string | number>): string;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { GraphQLSchema, GraphQLNamedType, GraphQLDirective } from 'graphql';
|
||||
export declare function addTypes(schema: GraphQLSchema, newTypesOrDirectives: Array<GraphQLNamedType | GraphQLDirective>): GraphQLSchema;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { GraphQLSchema, GraphQLNamedType, GraphQLDirective } from 'graphql';
|
||||
export declare function addTypes(schema: GraphQLSchema, newTypesOrDirectives: Array<GraphQLNamedType | GraphQLDirective>): GraphQLSchema;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { GraphQLType, TypeNode } from 'graphql';
|
||||
export declare function astFromType(type: GraphQLType): TypeNode;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { GraphQLType, TypeNode } from 'graphql';
|
||||
export declare function astFromType(type: GraphQLType): TypeNode;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { ValueNode } from 'graphql';
|
||||
/**
|
||||
* Produces a GraphQL Value AST given a JavaScript object.
|
||||
* Function will match JavaScript/JSON values to GraphQL AST schema format
|
||||
* by using the following mapping.
|
||||
*
|
||||
* | JSON Value | GraphQL Value |
|
||||
* | ------------- | -------------------- |
|
||||
* | Object | Input Object |
|
||||
* | Array | List |
|
||||
* | Boolean | Boolean |
|
||||
* | String | String |
|
||||
* | Number | Int / Float |
|
||||
* | null | NullValue |
|
||||
*
|
||||
*/
|
||||
export declare function astFromValueUntyped(value: any): ValueNode | null;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import { ValueNode } from 'graphql';
|
||||
/**
|
||||
* Produces a GraphQL Value AST given a JavaScript object.
|
||||
* Function will match JavaScript/JSON values to GraphQL AST schema format
|
||||
* by using the following mapping.
|
||||
*
|
||||
* | JSON Value | GraphQL Value |
|
||||
* | ------------- | -------------------- |
|
||||
* | Object | Input Object |
|
||||
* | Array | List |
|
||||
* | Boolean | Boolean |
|
||||
* | String | String |
|
||||
* | Number | Int / Float |
|
||||
* | null | NullValue |
|
||||
*
|
||||
*/
|
||||
export declare function astFromValueUntyped(value: any): ValueNode | null;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from 'graphql';
|
||||
export type Skip = string[];
|
||||
export type Force = string[];
|
||||
export type Ignore = string[];
|
||||
export type SelectedFields = {
|
||||
[key: string]: SelectedFields;
|
||||
} | boolean;
|
||||
export declare function buildOperationNodeForField({ schema, kind, field, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, }: {
|
||||
schema: GraphQLSchema;
|
||||
kind: OperationTypeNode;
|
||||
field: string;
|
||||
models?: string[];
|
||||
ignore?: Ignore;
|
||||
depthLimit?: number;
|
||||
circularReferenceDepth?: number;
|
||||
argNames?: string[];
|
||||
selectedFields?: SelectedFields;
|
||||
}): OperationDefinitionNode;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from 'graphql';
|
||||
export type Skip = string[];
|
||||
export type Force = string[];
|
||||
export type Ignore = string[];
|
||||
export type SelectedFields = {
|
||||
[key: string]: SelectedFields;
|
||||
} | boolean;
|
||||
export declare function buildOperationNodeForField({ schema, kind, field, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, }: {
|
||||
schema: GraphQLSchema;
|
||||
kind: OperationTypeNode;
|
||||
field: string;
|
||||
models?: string[];
|
||||
ignore?: Ignore;
|
||||
depthLimit?: number;
|
||||
circularReferenceDepth?: number;
|
||||
argNames?: string[];
|
||||
selectedFields?: SelectedFields;
|
||||
}): OperationDefinitionNode;
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
import { GraphQLSchema, FragmentDefinitionNode, GraphQLObjectType, SelectionSetNode, FieldNode, FragmentSpreadNode, InlineFragmentNode } from 'graphql';
|
||||
export interface PatchFields {
|
||||
label: string | undefined;
|
||||
fields: Map<string, Array<FieldNode>>;
|
||||
}
|
||||
export interface FieldsAndPatches {
|
||||
fields: Map<string, Array<FieldNode>>;
|
||||
patches: Array<PatchFields>;
|
||||
}
|
||||
/**
|
||||
* Given a selectionSet, collects all of the fields and returns them.
|
||||
*
|
||||
* CollectFields requires the "runtime type" of an object. For a field that
|
||||
* returns an Interface or Union type, the "runtime type" will be the actual
|
||||
* object type returned by that field.
|
||||
*
|
||||
*/
|
||||
export declare function collectFields<TVariables = any>(schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: TVariables, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode): FieldsAndPatches;
|
||||
/**
|
||||
* Determines if a field should be included based on the `@include` and `@skip`
|
||||
* directives, where `@skip` has higher precedence than `@include`.
|
||||
*/
|
||||
export declare function shouldIncludeNode(variableValues: any, node: FragmentSpreadNode | FieldNode | InlineFragmentNode): boolean;
|
||||
/**
|
||||
* Determines if a fragment is applicable to the given type.
|
||||
*/
|
||||
export declare function doesFragmentConditionMatch(schema: GraphQLSchema, fragment: FragmentDefinitionNode | InlineFragmentNode, type: GraphQLObjectType): boolean;
|
||||
/**
|
||||
* Implements the logic to compute the key of a given field's entry
|
||||
*/
|
||||
export declare function getFieldEntryKey(node: FieldNode): string;
|
||||
/**
|
||||
* Returns an object containing the `@defer` arguments if a field should be
|
||||
* deferred based on the experimental flag, defer directive present and
|
||||
* not disabled by the "if" argument.
|
||||
*/
|
||||
export declare function getDeferValues(variableValues: any, node: FragmentSpreadNode | InlineFragmentNode): undefined | {
|
||||
label: string | undefined;
|
||||
};
|
||||
/**
|
||||
* Given an array of field nodes, collects all of the subfields of the passed
|
||||
* in fields, and returns them at the end.
|
||||
*
|
||||
* CollectSubFields requires the "return type" of an object. For a field that
|
||||
* returns an Interface or Union type, the "return type" will be the actual
|
||||
* object type returned by that field.
|
||||
*
|
||||
*/
|
||||
export declare const collectSubFields: (schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: {
|
||||
[variable: string]: unknown;
|
||||
}, returnType: GraphQLObjectType, fieldNodes: Array<FieldNode>) => FieldsAndPatches;
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
import { GraphQLSchema, FragmentDefinitionNode, GraphQLObjectType, SelectionSetNode, FieldNode, FragmentSpreadNode, InlineFragmentNode } from 'graphql';
|
||||
export interface PatchFields {
|
||||
label: string | undefined;
|
||||
fields: Map<string, Array<FieldNode>>;
|
||||
}
|
||||
export interface FieldsAndPatches {
|
||||
fields: Map<string, Array<FieldNode>>;
|
||||
patches: Array<PatchFields>;
|
||||
}
|
||||
/**
|
||||
* Given a selectionSet, collects all of the fields and returns them.
|
||||
*
|
||||
* CollectFields requires the "runtime type" of an object. For a field that
|
||||
* returns an Interface or Union type, the "runtime type" will be the actual
|
||||
* object type returned by that field.
|
||||
*
|
||||
*/
|
||||
export declare function collectFields<TVariables = any>(schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: TVariables, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode): FieldsAndPatches;
|
||||
/**
|
||||
* Determines if a field should be included based on the `@include` and `@skip`
|
||||
* directives, where `@skip` has higher precedence than `@include`.
|
||||
*/
|
||||
export declare function shouldIncludeNode(variableValues: any, node: FragmentSpreadNode | FieldNode | InlineFragmentNode): boolean;
|
||||
/**
|
||||
* Determines if a fragment is applicable to the given type.
|
||||
*/
|
||||
export declare function doesFragmentConditionMatch(schema: GraphQLSchema, fragment: FragmentDefinitionNode | InlineFragmentNode, type: GraphQLObjectType): boolean;
|
||||
/**
|
||||
* Implements the logic to compute the key of a given field's entry
|
||||
*/
|
||||
export declare function getFieldEntryKey(node: FieldNode): string;
|
||||
/**
|
||||
* Returns an object containing the `@defer` arguments if a field should be
|
||||
* deferred based on the experimental flag, defer directive present and
|
||||
* not disabled by the "if" argument.
|
||||
*/
|
||||
export declare function getDeferValues(variableValues: any, node: FragmentSpreadNode | InlineFragmentNode): undefined | {
|
||||
label: string | undefined;
|
||||
};
|
||||
/**
|
||||
* Given an array of field nodes, collects all of the subfields of the passed
|
||||
* in fields, and returns them at the end.
|
||||
*
|
||||
* CollectSubFields requires the "return type" of an object. For a field that
|
||||
* returns an Interface or Union type, the "return type" will be the actual
|
||||
* object type returned by that field.
|
||||
*
|
||||
*/
|
||||
export declare const collectSubFields: (schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: {
|
||||
[variable: string]: unknown;
|
||||
}, returnType: GraphQLObjectType, fieldNodes: Array<FieldNode>) => FieldsAndPatches;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { StringValueNode, ASTNode, NameNode, DefinitionNode, Location } from 'graphql';
|
||||
export type NamedDefinitionNode = DefinitionNode & {
|
||||
name?: NameNode;
|
||||
};
|
||||
export declare function resetComments(): void;
|
||||
export declare function collectComment(node: NamedDefinitionNode): void;
|
||||
export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void;
|
||||
export declare function printComment(comment: string): string;
|
||||
/**
|
||||
* Converts an AST into a string, using one set of reasonable
|
||||
* formatting rules.
|
||||
*/
|
||||
export declare function printWithComments(ast: ASTNode): string;
|
||||
export declare function getDescription(node: {
|
||||
description?: StringValueNode;
|
||||
loc?: Location;
|
||||
}, options?: {
|
||||
commentDescriptions?: boolean;
|
||||
}): string | undefined;
|
||||
export declare function getComment(node: {
|
||||
loc?: Location;
|
||||
}): undefined | string;
|
||||
export declare function getLeadingCommentBlock(node: {
|
||||
loc?: Location;
|
||||
}): void | string;
|
||||
export declare function dedentBlockStringValue(rawString: string): string;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare function getBlockStringIndentation(lines: ReadonlyArray<string>): number;
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { StringValueNode, ASTNode, NameNode, DefinitionNode, Location } from 'graphql';
|
||||
export type NamedDefinitionNode = DefinitionNode & {
|
||||
name?: NameNode;
|
||||
};
|
||||
export declare function resetComments(): void;
|
||||
export declare function collectComment(node: NamedDefinitionNode): void;
|
||||
export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void;
|
||||
export declare function printComment(comment: string): string;
|
||||
/**
|
||||
* Converts an AST into a string, using one set of reasonable
|
||||
* formatting rules.
|
||||
*/
|
||||
export declare function printWithComments(ast: ASTNode): string;
|
||||
export declare function getDescription(node: {
|
||||
description?: StringValueNode;
|
||||
loc?: Location;
|
||||
}, options?: {
|
||||
commentDescriptions?: boolean;
|
||||
}): string | undefined;
|
||||
export declare function getComment(node: {
|
||||
loc?: Location;
|
||||
}): undefined | string;
|
||||
export declare function getLeadingCommentBlock(node: {
|
||||
loc?: Location;
|
||||
}): void | string;
|
||||
export declare function dedentBlockStringValue(rawString: string): string;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare function getBlockStringIndentation(lines: ReadonlyArray<string>): number;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { GraphQLDirective } from 'graphql';
|
||||
/**
|
||||
* Used to conditionally defer fragments.
|
||||
*/
|
||||
export declare const GraphQLDeferDirective: GraphQLDirective;
|
||||
/**
|
||||
* Used to conditionally stream list fields.
|
||||
*/
|
||||
export declare const GraphQLStreamDirective: GraphQLDirective;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { GraphQLDirective } from 'graphql';
|
||||
/**
|
||||
* Used to conditionally defer fragments.
|
||||
*/
|
||||
export declare const GraphQLDeferDirective: GraphQLDirective;
|
||||
/**
|
||||
* Used to conditionally stream list fields.
|
||||
*/
|
||||
export declare const GraphQLStreamDirective: GraphQLDirective;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { ASTNode, GraphQLError, Source } from 'graphql';
|
||||
import { Maybe } from './types.cjs';
|
||||
interface GraphQLErrorOptions {
|
||||
nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
|
||||
source?: Maybe<Source>;
|
||||
positions?: Maybe<ReadonlyArray<number>>;
|
||||
path?: Maybe<ReadonlyArray<string | number>>;
|
||||
originalError?: Maybe<Error & {
|
||||
readonly extensions?: unknown;
|
||||
}>;
|
||||
extensions?: any;
|
||||
}
|
||||
export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
|
||||
export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>): GraphQLError;
|
||||
export {};
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { ASTNode, GraphQLError, Source } from 'graphql';
|
||||
import { Maybe } from './types.js';
|
||||
interface GraphQLErrorOptions {
|
||||
nodes?: ReadonlyArray<ASTNode> | ASTNode | null;
|
||||
source?: Maybe<Source>;
|
||||
positions?: Maybe<ReadonlyArray<number>>;
|
||||
path?: Maybe<ReadonlyArray<string | number>>;
|
||||
originalError?: Maybe<Error & {
|
||||
readonly extensions?: unknown;
|
||||
}>;
|
||||
extensions?: any;
|
||||
}
|
||||
export declare function createGraphQLError(message: string, options?: GraphQLErrorOptions): GraphQLError;
|
||||
export declare function relocatedError(originalError: GraphQLError, path?: ReadonlyArray<string | number>): GraphQLError;
|
||||
export {};
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { ExecutionResult, ExecutionRequest } from './Interfaces.cjs';
|
||||
export type MaybePromise<T> = PromiseLike<T> | T;
|
||||
export type MaybeAsyncIterable<T> = AsyncIterable<T> | T;
|
||||
export type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
|
||||
export type SyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => ExecutionResult<TReturn>;
|
||||
export type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { ExecutionResult, ExecutionRequest } from './Interfaces.js';
|
||||
export type MaybePromise<T> = PromiseLike<T> | T;
|
||||
export type MaybeAsyncIterable<T> = AsyncIterable<T> | T;
|
||||
export type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => Promise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
|
||||
export type SyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => ExecutionResult<TReturn>;
|
||||
export type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs extends Record<string, any> = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions, TReturn>) => MaybePromise<MaybeAsyncIterable<ExecutionResult<TReturn>>>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { SchemaExtensions } from './types.cjs';
|
||||
export declare function extractExtensionsFromSchema(schema: GraphQLSchema): SchemaExtensions;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { SchemaExtensions } from './types.js';
|
||||
export declare function extractExtensionsFromSchema(schema: GraphQLSchema): SchemaExtensions;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { GraphQLFieldConfigMap, GraphQLFieldConfig, GraphQLSchema } from 'graphql';
|
||||
export declare function appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap<any, any>): GraphQLSchema;
|
||||
export declare function removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
||||
export declare function selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): GraphQLFieldConfigMap<any, any>;
|
||||
export declare function modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean, newFields: GraphQLFieldConfigMap<any, any>): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { GraphQLFieldConfigMap, GraphQLFieldConfig, GraphQLSchema } from 'graphql';
|
||||
export declare function appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap<any, any>): GraphQLSchema;
|
||||
export declare function removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
||||
export declare function selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): GraphQLFieldConfigMap<any, any>;
|
||||
export declare function modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean, newFields: GraphQLFieldConfigMap<any, any>): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { FieldFilter, RootFieldFilter, TypeFilter, ArgumentFilter } from './Interfaces.cjs';
|
||||
export declare function filterSchema({ schema, typeFilter, fieldFilter, rootFieldFilter, objectFieldFilter, interfaceFieldFilter, inputObjectFieldFilter, argumentFilter, }: {
|
||||
schema: GraphQLSchema;
|
||||
rootFieldFilter?: RootFieldFilter;
|
||||
typeFilter?: TypeFilter;
|
||||
fieldFilter?: FieldFilter;
|
||||
objectFieldFilter?: FieldFilter;
|
||||
interfaceFieldFilter?: FieldFilter;
|
||||
inputObjectFieldFilter?: FieldFilter;
|
||||
argumentFilter?: ArgumentFilter;
|
||||
}): GraphQLSchema;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { FieldFilter, RootFieldFilter, TypeFilter, ArgumentFilter } from './Interfaces.js';
|
||||
export declare function filterSchema({ schema, typeFilter, fieldFilter, rootFieldFilter, objectFieldFilter, interfaceFieldFilter, inputObjectFieldFilter, argumentFilter, }: {
|
||||
schema: GraphQLSchema;
|
||||
rootFieldFilter?: RootFieldFilter;
|
||||
typeFilter?: TypeFilter;
|
||||
fieldFilter?: FieldFilter;
|
||||
objectFieldFilter?: FieldFilter;
|
||||
interfaceFieldFilter?: FieldFilter;
|
||||
inputObjectFieldFilter?: FieldFilter;
|
||||
argumentFilter?: ArgumentFilter;
|
||||
}): GraphQLSchema;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema, BuildSchemaOptions } from 'graphql';
|
||||
import { SchemaPrintOptions } from './types.cjs';
|
||||
export declare function fixSchemaAst(schema: GraphQLSchema, options: BuildSchemaOptions & SchemaPrintOptions): GraphQLSchema;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema, BuildSchemaOptions } from 'graphql';
|
||||
import { SchemaPrintOptions } from './types.js';
|
||||
export declare function fixSchemaAst(schema: GraphQLSchema, options: BuildSchemaOptions & SchemaPrintOptions): GraphQLSchema;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { IDefaultValueIteratorFn } from './Interfaces.cjs';
|
||||
export declare function forEachDefaultValue(schema: GraphQLSchema, fn: IDefaultValueIteratorFn): void;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { IDefaultValueIteratorFn } from './Interfaces.js';
|
||||
export declare function forEachDefaultValue(schema: GraphQLSchema, fn: IDefaultValueIteratorFn): void;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { IFieldIteratorFn } from './Interfaces.cjs';
|
||||
export declare function forEachField(schema: GraphQLSchema, fn: IFieldIteratorFn): void;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { IFieldIteratorFn } from './Interfaces.js';
|
||||
export declare function forEachField(schema: GraphQLSchema, fn: IFieldIteratorFn): void;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { DirectiveUsage } from './types.cjs';
|
||||
import { DocumentNode } from 'graphql';
|
||||
export type ArgumentToDirectives = {
|
||||
[argumentName: string]: DirectiveUsage[];
|
||||
};
|
||||
export type TypeAndFieldToArgumentDirectives = {
|
||||
[typeAndField: string]: ArgumentToDirectives;
|
||||
};
|
||||
export declare function getArgumentsWithDirectives(documentNode: DocumentNode): TypeAndFieldToArgumentDirectives;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { DirectiveUsage } from './types.js';
|
||||
import { DocumentNode } from 'graphql';
|
||||
export type ArgumentToDirectives = {
|
||||
[argumentName: string]: DirectiveUsage[];
|
||||
};
|
||||
export type TypeAndFieldToArgumentDirectives = {
|
||||
[typeAndField: string]: ArgumentToDirectives;
|
||||
};
|
||||
export declare function getArgumentsWithDirectives(documentNode: DocumentNode): TypeAndFieldToArgumentDirectives;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { GraphQLSchema, GraphQLNamedType, GraphQLField, GraphQLInputField, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLSchemaConfig, GraphQLObjectTypeConfig, GraphQLInterfaceTypeConfig, GraphQLUnionTypeConfig, GraphQLScalarTypeConfig, GraphQLEnumTypeConfig, GraphQLInputObjectTypeConfig, GraphQLEnumValue, GraphQLEnumValueConfig } from 'graphql';
|
||||
export interface DirectiveAnnotation {
|
||||
name: string;
|
||||
args?: Record<string, any>;
|
||||
}
|
||||
type DirectableGraphQLObject = GraphQLSchema | GraphQLSchemaConfig | GraphQLNamedType | GraphQLObjectTypeConfig<any, any> | GraphQLInterfaceTypeConfig<any, any> | GraphQLUnionTypeConfig<any, any> | GraphQLScalarTypeConfig<any, any> | GraphQLEnumTypeConfig | GraphQLEnumValue | GraphQLEnumValueConfig | GraphQLInputObjectTypeConfig | GraphQLField<any, any> | GraphQLInputField | GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig;
|
||||
export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array<DirectiveAnnotation>;
|
||||
export declare function getDirectiveInExtensions(node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array<Record<string, any>> | undefined;
|
||||
export declare function getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array<DirectiveAnnotation>;
|
||||
export declare function getDirective(schema: GraphQLSchema, node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array<Record<string, any>> | undefined;
|
||||
export {};
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { GraphQLSchema, GraphQLNamedType, GraphQLField, GraphQLInputField, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLSchemaConfig, GraphQLObjectTypeConfig, GraphQLInterfaceTypeConfig, GraphQLUnionTypeConfig, GraphQLScalarTypeConfig, GraphQLEnumTypeConfig, GraphQLInputObjectTypeConfig, GraphQLEnumValue, GraphQLEnumValueConfig } from 'graphql';
|
||||
export interface DirectiveAnnotation {
|
||||
name: string;
|
||||
args?: Record<string, any>;
|
||||
}
|
||||
type DirectableGraphQLObject = GraphQLSchema | GraphQLSchemaConfig | GraphQLNamedType | GraphQLObjectTypeConfig<any, any> | GraphQLInterfaceTypeConfig<any, any> | GraphQLUnionTypeConfig<any, any> | GraphQLScalarTypeConfig<any, any> | GraphQLEnumTypeConfig | GraphQLEnumValue | GraphQLEnumValueConfig | GraphQLInputObjectTypeConfig | GraphQLField<any, any> | GraphQLInputField | GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig;
|
||||
export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array<DirectiveAnnotation>;
|
||||
export declare function getDirectiveInExtensions(node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array<Record<string, any>> | undefined;
|
||||
export declare function getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array<DirectiveAnnotation>;
|
||||
export declare function getDirective(schema: GraphQLSchema, node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array<Record<string, any>> | undefined;
|
||||
export {};
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { DocumentNode } from 'graphql';
|
||||
import { DirectiveUsage } from './types.cjs';
|
||||
export type TypeAndFieldToDirectives = {
|
||||
[typeAndField: string]: DirectiveUsage[];
|
||||
};
|
||||
interface Options {
|
||||
includeInputTypes?: boolean;
|
||||
}
|
||||
export declare function getFieldsWithDirectives(documentNode: DocumentNode, options?: Options): TypeAndFieldToDirectives;
|
||||
export {};
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { DocumentNode } from 'graphql';
|
||||
import { DirectiveUsage } from './types.js';
|
||||
export type TypeAndFieldToDirectives = {
|
||||
[typeAndField: string]: DirectiveUsage[];
|
||||
};
|
||||
interface Options {
|
||||
includeInputTypes?: boolean;
|
||||
}
|
||||
export declare function getFieldsWithDirectives(documentNode: DocumentNode, options?: Options): TypeAndFieldToDirectives;
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
export declare function getImplementingTypes(interfaceName: string, schema: GraphQLSchema): string[];
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
export declare function getImplementingTypes(interfaceName: string, schema: GraphQLSchema): string[];
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { GraphQLField, GraphQLDirective, DirectiveNode, FieldNode } from 'graphql';
|
||||
/**
|
||||
* Prepares an object map of argument values given a list of argument
|
||||
* definitions and list of argument AST nodes.
|
||||
*
|
||||
* Note: The returned value is a plain Object with a prototype, since it is
|
||||
* exposed to user code. Care should be taken to not pull values from the
|
||||
* Object prototype.
|
||||
*/
|
||||
export declare function getArgumentValues(def: GraphQLField<any, any> | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Record<string, any>): Record<string, any>;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { GraphQLField, GraphQLDirective, DirectiveNode, FieldNode } from 'graphql';
|
||||
/**
|
||||
* Prepares an object map of argument values given a list of argument
|
||||
* definitions and list of argument AST nodes.
|
||||
*
|
||||
* Note: The returned value is a plain Object with a prototype, since it is
|
||||
* exposed to user code. Care should be taken to not pull values from the
|
||||
* Object prototype.
|
||||
*/
|
||||
export declare function getArgumentValues(def: GraphQLField<any, any> | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Record<string, any>): Record<string, any>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLNamedType, GraphQLObjectType } from 'graphql';
|
||||
import { Maybe } from './types.cjs';
|
||||
export declare function getObjectTypeFromTypeMap(typeMap: Record<string, GraphQLNamedType>, type: Maybe<GraphQLObjectType>): GraphQLObjectType | undefined;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLNamedType, GraphQLObjectType } from 'graphql';
|
||||
import { Maybe } from './types.js';
|
||||
export declare function getObjectTypeFromTypeMap(typeMap: Record<string, GraphQLNamedType>, type: Maybe<GraphQLObjectType>): GraphQLObjectType | undefined;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { DocumentNode, OperationDefinitionNode } from 'graphql';
|
||||
import { ExecutionRequest } from './Interfaces.cjs';
|
||||
export declare function getOperationASTFromDocument(documentNode: DocumentNode, operationName?: string): OperationDefinitionNode;
|
||||
export declare const getOperationASTFromRequest: (request: ExecutionRequest) => OperationDefinitionNode;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { DocumentNode, OperationDefinitionNode } from 'graphql';
|
||||
import { ExecutionRequest } from './Interfaces.js';
|
||||
export declare function getOperationASTFromDocument(documentNode: DocumentNode, operationName?: string): OperationDefinitionNode;
|
||||
export declare const getOperationASTFromRequest: (request: ExecutionRequest) => OperationDefinitionNode;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { IResolvers } from './Interfaces.cjs';
|
||||
export declare function getResolversFromSchema(schema: GraphQLSchema, includeDefaultMergedResolver?: boolean): IResolvers;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { IResolvers } from './Interfaces.js';
|
||||
export declare function getResolversFromSchema(schema: GraphQLSchema, includeDefaultMergedResolver?: boolean): IResolvers;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { GraphQLResolveInfo } from 'graphql';
|
||||
/**
|
||||
* Get the key under which the result of this resolver will be placed in the response JSON. Basically, just
|
||||
* resolves aliases.
|
||||
* @param info The info argument to the resolver.
|
||||
*/
|
||||
export declare function getResponseKeyFromInfo(info: GraphQLResolveInfo): string;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { GraphQLResolveInfo } from 'graphql';
|
||||
/**
|
||||
* Get the key under which the result of this resolver will be placed in the response JSON. Basically, just
|
||||
* resolves aliases.
|
||||
* @param info The info argument to the resolver.
|
||||
*/
|
||||
export declare function getResponseKeyFromInfo(info: GraphQLResolveInfo): string;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql';
|
||||
export declare function healSchema(schema: GraphQLSchema): GraphQLSchema;
|
||||
export declare function healTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>): void;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql';
|
||||
export declare function healSchema(schema: GraphQLSchema): GraphQLSchema;
|
||||
export declare function healTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>): void;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { ASTNode } from 'graphql';
|
||||
export declare const asArray: <T>(fns: T | T[]) => T[];
|
||||
export declare function isDocumentString(str: any): boolean;
|
||||
export declare function isValidPath(str: any): boolean;
|
||||
export declare function compareStrings<A, B>(a: A, b: B): 1 | -1 | 0;
|
||||
export declare function nodeToString(a: ASTNode): string;
|
||||
export declare function compareNodes(a: ASTNode, b: ASTNode, customFn?: (a: any, b: any) => number): number;
|
||||
export declare function isSome<T>(input: T): input is Exclude<T, null | undefined>;
|
||||
export declare function assertSome<T>(input: T, message?: string): asserts input is Exclude<T, null | undefined>;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { ASTNode } from 'graphql';
|
||||
export declare const asArray: <T>(fns: T | T[]) => T[];
|
||||
export declare function isDocumentString(str: any): boolean;
|
||||
export declare function isValidPath(str: any): boolean;
|
||||
export declare function compareStrings<A, B>(a: A, b: B): 1 | -1 | 0;
|
||||
export declare function nodeToString(a: ASTNode): string;
|
||||
export declare function compareNodes(a: ASTNode, b: ASTNode, customFn?: (a: any, b: any) => number): number;
|
||||
export declare function isSome<T>(input: T): input is Exclude<T, null | undefined>;
|
||||
export declare function assertSome<T>(input: T, message?: string): asserts input is Exclude<T, null | undefined>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLType, GraphQLSchema } from 'graphql';
|
||||
import { Maybe } from './types.cjs';
|
||||
export declare function implementsAbstractType(schema: GraphQLSchema, typeA: Maybe<GraphQLType>, typeB: Maybe<GraphQLType>): boolean;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphQLType, GraphQLSchema } from 'graphql';
|
||||
import { Maybe } from './types.js';
|
||||
export declare function implementsAbstractType(schema: GraphQLSchema, typeA: Maybe<GraphQLType>, typeB: Maybe<GraphQLType>): boolean;
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
export * from './loaders.cjs';
|
||||
export * from './helpers.cjs';
|
||||
export * from './get-directives.cjs';
|
||||
export * from './get-fields-with-directives.cjs';
|
||||
export * from './get-arguments-with-directives.cjs';
|
||||
export * from './get-implementing-types.cjs';
|
||||
export * from './print-schema-with-directives.cjs';
|
||||
export * from './get-fields-with-directives.cjs';
|
||||
export * from './validate-documents.cjs';
|
||||
export * from './parse-graphql-json.cjs';
|
||||
export * from './parse-graphql-sdl.cjs';
|
||||
export * from './build-operation-for-field.cjs';
|
||||
export * from './types.cjs';
|
||||
export * from './filterSchema.cjs';
|
||||
export * from './heal.cjs';
|
||||
export * from './getResolversFromSchema.cjs';
|
||||
export * from './forEachField.cjs';
|
||||
export * from './forEachDefaultValue.cjs';
|
||||
export * from './mapSchema.cjs';
|
||||
export * from './addTypes.cjs';
|
||||
export * from './rewire.cjs';
|
||||
export * from './prune.cjs';
|
||||
export * from './mergeDeep.cjs';
|
||||
export * from './Interfaces.cjs';
|
||||
export * from './stub.cjs';
|
||||
export * from './selectionSets.cjs';
|
||||
export * from './getResponseKeyFromInfo.cjs';
|
||||
export * from './fields.cjs';
|
||||
export * from './renameType.cjs';
|
||||
export * from './transformInputValue.cjs';
|
||||
export * from './mapAsyncIterator.cjs';
|
||||
export * from './updateArgument.cjs';
|
||||
export * from './implementsAbstractType.cjs';
|
||||
export * from './errors.cjs';
|
||||
export * from './observableToAsyncIterable.cjs';
|
||||
export * from './visitResult.cjs';
|
||||
export * from './getArgumentValues.cjs';
|
||||
export * from './valueMatchesCriteria.cjs';
|
||||
export * from './isAsyncIterable.cjs';
|
||||
export * from './isDocumentNode.cjs';
|
||||
export * from './astFromValueUntyped.cjs';
|
||||
export * from './executor.cjs';
|
||||
export * from './withCancel.cjs';
|
||||
export * from './AggregateError.cjs';
|
||||
export * from './rootTypes.cjs';
|
||||
export * from './comments.cjs';
|
||||
export * from './collectFields.cjs';
|
||||
export * from './inspect.cjs';
|
||||
export * from './memoize.cjs';
|
||||
export * from './fixSchemaAst.cjs';
|
||||
export * from './getOperationASTFromRequest.cjs';
|
||||
export * from './extractExtensionsFromSchema.cjs';
|
||||
export * from './Path.cjs';
|
||||
export * from './jsutils.cjs';
|
||||
export * from './directives.cjs';
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
export * from './loaders.js';
|
||||
export * from './helpers.js';
|
||||
export * from './get-directives.js';
|
||||
export * from './get-fields-with-directives.js';
|
||||
export * from './get-arguments-with-directives.js';
|
||||
export * from './get-implementing-types.js';
|
||||
export * from './print-schema-with-directives.js';
|
||||
export * from './get-fields-with-directives.js';
|
||||
export * from './validate-documents.js';
|
||||
export * from './parse-graphql-json.js';
|
||||
export * from './parse-graphql-sdl.js';
|
||||
export * from './build-operation-for-field.js';
|
||||
export * from './types.js';
|
||||
export * from './filterSchema.js';
|
||||
export * from './heal.js';
|
||||
export * from './getResolversFromSchema.js';
|
||||
export * from './forEachField.js';
|
||||
export * from './forEachDefaultValue.js';
|
||||
export * from './mapSchema.js';
|
||||
export * from './addTypes.js';
|
||||
export * from './rewire.js';
|
||||
export * from './prune.js';
|
||||
export * from './mergeDeep.js';
|
||||
export * from './Interfaces.js';
|
||||
export * from './stub.js';
|
||||
export * from './selectionSets.js';
|
||||
export * from './getResponseKeyFromInfo.js';
|
||||
export * from './fields.js';
|
||||
export * from './renameType.js';
|
||||
export * from './transformInputValue.js';
|
||||
export * from './mapAsyncIterator.js';
|
||||
export * from './updateArgument.js';
|
||||
export * from './implementsAbstractType.js';
|
||||
export * from './errors.js';
|
||||
export * from './observableToAsyncIterable.js';
|
||||
export * from './visitResult.js';
|
||||
export * from './getArgumentValues.js';
|
||||
export * from './valueMatchesCriteria.js';
|
||||
export * from './isAsyncIterable.js';
|
||||
export * from './isDocumentNode.js';
|
||||
export * from './astFromValueUntyped.js';
|
||||
export * from './executor.js';
|
||||
export * from './withCancel.js';
|
||||
export * from './AggregateError.js';
|
||||
export * from './rootTypes.js';
|
||||
export * from './comments.js';
|
||||
export * from './collectFields.js';
|
||||
export * from './inspect.js';
|
||||
export * from './memoize.js';
|
||||
export * from './fixSchemaAst.js';
|
||||
export * from './getOperationASTFromRequest.js';
|
||||
export * from './extractExtensionsFromSchema.js';
|
||||
export * from './Path.js';
|
||||
export * from './jsutils.js';
|
||||
export * from './directives.js';
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Used to print values in error messages.
|
||||
*/
|
||||
export declare function inspect(value: unknown): string;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Used to print values in error messages.
|
||||
*/
|
||||
export declare function inspect(value: unknown): string;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function isAsyncIterable<T>(value: any): value is AsyncIterable<T>;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function isAsyncIterable<T>(value: any): value is AsyncIterable<T>;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { DocumentNode } from 'graphql';
|
||||
export declare function isDocumentNode(object: any): object is DocumentNode;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { DocumentNode } from 'graphql';
|
||||
export declare function isDocumentNode(object: any): object is DocumentNode;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { MaybePromise } from './executor.cjs';
|
||||
export declare function isIterableObject(value: unknown): value is Iterable<unknown>;
|
||||
export declare function isObjectLike(value: unknown): value is {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
export declare function isPromise<T>(value: unknown): value is PromiseLike<T>;
|
||||
export declare function promiseReduce<T, U>(values: Iterable<T>, callbackFn: (accumulator: U, currentValue: T) => MaybePromise<U>, initialValue: MaybePromise<U>): MaybePromise<U>;
|
||||
export declare function hasOwnProperty(obj: unknown, prop: string): boolean;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { MaybePromise } from './executor.js';
|
||||
export declare function isIterableObject(value: unknown): value is Iterable<unknown>;
|
||||
export declare function isObjectLike(value: unknown): value is {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
export declare function isPromise<T>(value: unknown): value is PromiseLike<T>;
|
||||
export declare function promiseReduce<T, U>(values: Iterable<T>, callbackFn: (accumulator: U, currentValue: T) => MaybePromise<U>, initialValue: MaybePromise<U>): MaybePromise<U>;
|
||||
export declare function hasOwnProperty(obj: unknown, prop: string): boolean;
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { DocumentNode, GraphQLSchema, BuildSchemaOptions } from 'graphql';
|
||||
import { GraphQLParseOptions } from './Interfaces.cjs';
|
||||
export interface Source {
|
||||
document?: DocumentNode;
|
||||
schema?: GraphQLSchema;
|
||||
rawSDL?: string;
|
||||
location?: string;
|
||||
}
|
||||
export type BaseLoaderOptions = GraphQLParseOptions & BuildSchemaOptions & {
|
||||
cwd?: string;
|
||||
ignore?: string | string[];
|
||||
};
|
||||
export type WithList<T> = T | T[];
|
||||
export type ElementOf<TList> = TList extends Array<infer TElement> ? TElement : never;
|
||||
export interface Loader<TOptions extends BaseLoaderOptions = BaseLoaderOptions> {
|
||||
load(pointer: string, options?: TOptions): Promise<Source[] | null | never>;
|
||||
loadSync?(pointer: string, options?: TOptions): Source[] | null | never;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { DocumentNode, GraphQLSchema, BuildSchemaOptions } from 'graphql';
|
||||
import { GraphQLParseOptions } from './Interfaces.js';
|
||||
export interface Source {
|
||||
document?: DocumentNode;
|
||||
schema?: GraphQLSchema;
|
||||
rawSDL?: string;
|
||||
location?: string;
|
||||
}
|
||||
export type BaseLoaderOptions = GraphQLParseOptions & BuildSchemaOptions & {
|
||||
cwd?: string;
|
||||
ignore?: string | string[];
|
||||
};
|
||||
export type WithList<T> = T | T[];
|
||||
export type ElementOf<TList> = TList extends Array<infer TElement> ? TElement : never;
|
||||
export interface Loader<TOptions extends BaseLoaderOptions = BaseLoaderOptions> {
|
||||
load(pointer: string, options?: TOptions): Promise<Source[] | null | never>;
|
||||
loadSync?(pointer: string, options?: TOptions): Source[] | null | never;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Given an AsyncIterable and a callback function, return an AsyncIterator
|
||||
* which produces values mapped via calling the callback function.
|
||||
*/
|
||||
export declare function mapAsyncIterator<T, U>(iterator: AsyncIterator<T>, callback: (value: T) => Promise<U> | U, rejectCallback?: any): AsyncIterableIterator<U>;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Given an AsyncIterable and a callback function, return an AsyncIterator
|
||||
* which produces values mapped via calling the callback function.
|
||||
*/
|
||||
export declare function mapAsyncIterator<T, U>(iterator: AsyncIterator<T>, callback: (value: T) => Promise<U> | U, rejectCallback?: any): AsyncIterableIterator<U>;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { GraphQLObjectType, GraphQLSchema, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLEnumType } from 'graphql';
|
||||
import { SchemaMapper } from './Interfaces.cjs';
|
||||
export declare function mapSchema(schema: GraphQLSchema, schemaMapper?: SchemaMapper): GraphQLSchema;
|
||||
export declare function correctASTNodes(type: GraphQLObjectType): GraphQLObjectType;
|
||||
export declare function correctASTNodes(type: GraphQLInterfaceType): GraphQLInterfaceType;
|
||||
export declare function correctASTNodes(type: GraphQLInputObjectType): GraphQLInputObjectType;
|
||||
export declare function correctASTNodes(type: GraphQLEnumType): GraphQLEnumType;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { GraphQLObjectType, GraphQLSchema, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLEnumType } from 'graphql';
|
||||
import { SchemaMapper } from './Interfaces.js';
|
||||
export declare function mapSchema(schema: GraphQLSchema, schemaMapper?: SchemaMapper): GraphQLSchema;
|
||||
export declare function correctASTNodes(type: GraphQLObjectType): GraphQLObjectType;
|
||||
export declare function correctASTNodes(type: GraphQLInterfaceType): GraphQLInterfaceType;
|
||||
export declare function correctASTNodes(type: GraphQLInputObjectType): GraphQLInputObjectType;
|
||||
export declare function correctASTNodes(type: GraphQLEnumType): GraphQLEnumType;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
export declare function memoize1<F extends (a1: any) => any>(fn: F): F;
|
||||
export declare function memoize2<F extends (a1: any, a2: any) => any>(fn: F): F;
|
||||
export declare function memoize3<F extends (a1: any, a2: any, a3: any) => any>(fn: F): F;
|
||||
export declare function memoize4<F extends (a1: any, a2: any, a3: any, a4: any) => any>(fn: F): F;
|
||||
export declare function memoize5<F extends (a1: any, a2: any, a3: any, a4: any, a5: any) => any>(fn: F): F;
|
||||
export declare function memoize2of4<F extends (a1: any, a2: any, a3: any, a4: any) => any>(fn: F): F;
|
||||
export declare function memoize2of5<F extends (a1: any, a2: any, a3: any, a4: any, a5: any) => any>(fn: F): F;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
export declare function memoize1<F extends (a1: any) => any>(fn: F): F;
|
||||
export declare function memoize2<F extends (a1: any, a2: any) => any>(fn: F): F;
|
||||
export declare function memoize3<F extends (a1: any, a2: any, a3: any) => any>(fn: F): F;
|
||||
export declare function memoize4<F extends (a1: any, a2: any, a3: any, a4: any) => any>(fn: F): F;
|
||||
export declare function memoize5<F extends (a1: any, a2: any, a3: any, a4: any, a5: any) => any>(fn: F): F;
|
||||
export declare function memoize2of4<F extends (a1: any, a2: any, a3: any, a4: any) => any>(fn: F): F;
|
||||
export declare function memoize2of5<F extends (a1: any, a2: any, a3: any, a4: any, a5: any) => any>(fn: F): F;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
type BoxedTupleTypes<T extends any[]> = {
|
||||
[P in keyof T]: [T[P]];
|
||||
}[Exclude<keyof T, keyof any[]>];
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
||||
type UnboxIntersection<T> = T extends {
|
||||
0: infer U;
|
||||
} ? U : never;
|
||||
export declare function mergeDeep<S extends any[]>(sources: S, respectPrototype?: boolean): UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> & any;
|
||||
export {};
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
type BoxedTupleTypes<T extends any[]> = {
|
||||
[P in keyof T]: [T[P]];
|
||||
}[Exclude<keyof T, keyof any[]>];
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
||||
type UnboxIntersection<T> = T extends {
|
||||
0: infer U;
|
||||
} ? U : never;
|
||||
export declare function mergeDeep<S extends any[]>(sources: S, respectPrototype?: boolean): UnboxIntersection<UnionToIntersection<BoxedTupleTypes<S>>> & any;
|
||||
export {};
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
export interface Observer<T> {
|
||||
next: (value: T) => void;
|
||||
error: (error: Error) => void;
|
||||
complete: () => void;
|
||||
}
|
||||
export interface Observable<T> {
|
||||
subscribe(observer: Observer<T>): {
|
||||
unsubscribe: () => void;
|
||||
};
|
||||
}
|
||||
export type Callback = (value?: any) => any;
|
||||
export declare function observableToAsyncIterable<T>(observable: Observable<T>): AsyncIterableIterator<T>;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
export interface Observer<T> {
|
||||
next: (value: T) => void;
|
||||
error: (error: Error) => void;
|
||||
complete: () => void;
|
||||
}
|
||||
export interface Observable<T> {
|
||||
subscribe(observer: Observer<T>): {
|
||||
unsubscribe: () => void;
|
||||
};
|
||||
}
|
||||
export type Callback = (value?: any) => any;
|
||||
export declare function observableToAsyncIterable<T>(observable: Observable<T>): AsyncIterableIterator<T>;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { ParseOptions } from 'graphql';
|
||||
import { Source } from './loaders.cjs';
|
||||
import { SchemaPrintOptions } from './types.cjs';
|
||||
export declare function parseGraphQLJSON(location: string, jsonContent: string, options: SchemaPrintOptions & ParseOptions): Source;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { ParseOptions } from 'graphql';
|
||||
import { Source } from './loaders.js';
|
||||
import { SchemaPrintOptions } from './types.js';
|
||||
export declare function parseGraphQLJSON(location: string, jsonContent: string, options: SchemaPrintOptions & ParseOptions): Source;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { DocumentNode, ASTNode, StringValueNode } from 'graphql';
|
||||
import { GraphQLParseOptions } from './Interfaces.cjs';
|
||||
export declare function parseGraphQLSDL(location: string | undefined, rawSDL: string, options?: GraphQLParseOptions): {
|
||||
location: string | undefined;
|
||||
document: DocumentNode;
|
||||
};
|
||||
export declare function transformCommentsToDescriptions(sourceSdl: string, options?: GraphQLParseOptions): DocumentNode;
|
||||
type DiscriminateUnion<T, U> = T extends U ? T : never;
|
||||
type DescribableASTNodes = DiscriminateUnion<ASTNode, {
|
||||
description?: StringValueNode;
|
||||
}>;
|
||||
export declare function isDescribable(node: ASTNode): node is DescribableASTNodes;
|
||||
export {};
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { DocumentNode, ASTNode, StringValueNode } from 'graphql';
|
||||
import { GraphQLParseOptions } from './Interfaces.js';
|
||||
export declare function parseGraphQLSDL(location: string | undefined, rawSDL: string, options?: GraphQLParseOptions): {
|
||||
location: string | undefined;
|
||||
document: DocumentNode;
|
||||
};
|
||||
export declare function transformCommentsToDescriptions(sourceSdl: string, options?: GraphQLParseOptions): DocumentNode;
|
||||
type DiscriminateUnion<T, U> = T extends U ? T : never;
|
||||
type DescribableASTNodes = DiscriminateUnion<ASTNode, {
|
||||
description?: StringValueNode;
|
||||
}>;
|
||||
export declare function isDescribable(node: ASTNode): node is DescribableASTNodes;
|
||||
export {};
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import { GraphQLSchema, GraphQLNamedType, DirectiveNode, FieldDefinitionNode, InputValueDefinitionNode, GraphQLArgument, EnumValueDefinitionNode, GraphQLDirective, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, GraphQLObjectType, ObjectTypeDefinitionNode, GraphQLField, GraphQLInterfaceType, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, GraphQLUnionType, GraphQLInputObjectType, InputObjectTypeDefinitionNode, GraphQLInputField, GraphQLEnumType, GraphQLEnumValue, EnumTypeDefinitionNode, GraphQLScalarType, ScalarTypeDefinitionNode, DocumentNode } from 'graphql';
|
||||
import { GetDocumentNodeFromSchemaOptions, PrintSchemaWithDirectivesOptions, Maybe } from './types.cjs';
|
||||
export declare function getDocumentNodeFromSchema(schema: GraphQLSchema, options?: GetDocumentNodeFromSchemaOptions): DocumentNode;
|
||||
export declare function printSchemaWithDirectives(schema: GraphQLSchema, options?: PrintSchemaWithDirectivesOptions): string;
|
||||
export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): SchemaDefinitionNode | SchemaExtensionNode | null;
|
||||
export declare function astFromDirective(directive: GraphQLDirective, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): DirectiveDefinitionNode;
|
||||
export declare function getDirectiveNodes(entity: GraphQLSchema | GraphQLNamedType | GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): Array<DirectiveNode>;
|
||||
export declare function getDeprecatableDirectiveNodes(entity: GraphQLArgument | GraphQLField<any, any> | GraphQLInputField | GraphQLEnumValue, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): Array<DirectiveNode>;
|
||||
export declare function astFromArg(arg: GraphQLArgument, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputValueDefinitionNode;
|
||||
export declare function astFromObjectType(type: GraphQLObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): ObjectTypeDefinitionNode;
|
||||
export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InterfaceTypeDefinitionNode;
|
||||
export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): UnionTypeDefinitionNode;
|
||||
export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputObjectTypeDefinitionNode;
|
||||
export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): EnumTypeDefinitionNode;
|
||||
export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): ScalarTypeDefinitionNode;
|
||||
export declare function astFromField(field: GraphQLField<any, any>, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): FieldDefinitionNode;
|
||||
export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputValueDefinitionNode;
|
||||
export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): EnumValueDefinitionNode;
|
||||
export declare function makeDeprecatedDirective(deprecationReason: string): DirectiveNode;
|
||||
export declare function makeDirectiveNode(name: string, args: Record<string, any>, directive?: Maybe<GraphQLDirective>): DirectiveNode;
|
||||
export declare function makeDirectiveNodes(schema: Maybe<GraphQLSchema>, directiveValues: Record<string, any>): Array<DirectiveNode>;
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import { GraphQLSchema, GraphQLNamedType, DirectiveNode, FieldDefinitionNode, InputValueDefinitionNode, GraphQLArgument, EnumValueDefinitionNode, GraphQLDirective, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, GraphQLObjectType, ObjectTypeDefinitionNode, GraphQLField, GraphQLInterfaceType, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, GraphQLUnionType, GraphQLInputObjectType, InputObjectTypeDefinitionNode, GraphQLInputField, GraphQLEnumType, GraphQLEnumValue, EnumTypeDefinitionNode, GraphQLScalarType, ScalarTypeDefinitionNode, DocumentNode } from 'graphql';
|
||||
import { GetDocumentNodeFromSchemaOptions, PrintSchemaWithDirectivesOptions, Maybe } from './types.js';
|
||||
export declare function getDocumentNodeFromSchema(schema: GraphQLSchema, options?: GetDocumentNodeFromSchemaOptions): DocumentNode;
|
||||
export declare function printSchemaWithDirectives(schema: GraphQLSchema, options?: PrintSchemaWithDirectivesOptions): string;
|
||||
export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): SchemaDefinitionNode | SchemaExtensionNode | null;
|
||||
export declare function astFromDirective(directive: GraphQLDirective, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): DirectiveDefinitionNode;
|
||||
export declare function getDirectiveNodes(entity: GraphQLSchema | GraphQLNamedType | GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): Array<DirectiveNode>;
|
||||
export declare function getDeprecatableDirectiveNodes(entity: GraphQLArgument | GraphQLField<any, any> | GraphQLInputField | GraphQLEnumValue, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): Array<DirectiveNode>;
|
||||
export declare function astFromArg(arg: GraphQLArgument, schema?: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputValueDefinitionNode;
|
||||
export declare function astFromObjectType(type: GraphQLObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): ObjectTypeDefinitionNode;
|
||||
export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InterfaceTypeDefinitionNode;
|
||||
export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): UnionTypeDefinitionNode;
|
||||
export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputObjectTypeDefinitionNode;
|
||||
export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): EnumTypeDefinitionNode;
|
||||
export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): ScalarTypeDefinitionNode;
|
||||
export declare function astFromField(field: GraphQLField<any, any>, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): FieldDefinitionNode;
|
||||
export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): InputValueDefinitionNode;
|
||||
export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions?: Array<string>): EnumValueDefinitionNode;
|
||||
export declare function makeDeprecatedDirective(deprecationReason: string): DirectiveNode;
|
||||
export declare function makeDirectiveNode(name: string, args: Record<string, any>, directive?: Maybe<GraphQLDirective>): DirectiveNode;
|
||||
export declare function makeDirectiveNodes(schema: Maybe<GraphQLSchema>, directiveValues: Record<string, any>): Array<DirectiveNode>;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { PruneSchemaOptions } from './types.cjs';
|
||||
/**
|
||||
* Prunes the provided schema, removing unused and empty types
|
||||
* @param schema The schema to prune
|
||||
* @param options Additional options for removing unused types from the schema
|
||||
*/
|
||||
export declare function pruneSchema(schema: GraphQLSchema, options?: PruneSchemaOptions): GraphQLSchema;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { GraphQLSchema } from 'graphql';
|
||||
import { PruneSchemaOptions } from './types.js';
|
||||
/**
|
||||
* Prunes the provided schema, removing unused and empty types
|
||||
* @param schema The schema to prune
|
||||
* @param options Additional options for removing unused types from the schema
|
||||
*/
|
||||
export declare function pruneSchema(schema: GraphQLSchema, options?: PruneSchemaOptions): GraphQLSchema;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLNamedType, GraphQLScalarType, GraphQLUnionType } from 'graphql';
|
||||
export declare function renameType(type: GraphQLObjectType, newTypeName: string): GraphQLObjectType;
|
||||
export declare function renameType(type: GraphQLInterfaceType, newTypeName: string): GraphQLInterfaceType;
|
||||
export declare function renameType(type: GraphQLUnionType, newTypeName: string): GraphQLUnionType;
|
||||
export declare function renameType(type: GraphQLEnumType, newTypeName: string): GraphQLEnumType;
|
||||
export declare function renameType(type: GraphQLScalarType, newTypeName: string): GraphQLScalarType;
|
||||
export declare function renameType(type: GraphQLInputObjectType, newTypeName: string): GraphQLInputObjectType;
|
||||
export declare function renameType(type: GraphQLNamedType, newTypeName: string): GraphQLNamedType;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLNamedType, GraphQLScalarType, GraphQLUnionType } from 'graphql';
|
||||
export declare function renameType(type: GraphQLObjectType, newTypeName: string): GraphQLObjectType;
|
||||
export declare function renameType(type: GraphQLInterfaceType, newTypeName: string): GraphQLInterfaceType;
|
||||
export declare function renameType(type: GraphQLUnionType, newTypeName: string): GraphQLUnionType;
|
||||
export declare function renameType(type: GraphQLEnumType, newTypeName: string): GraphQLEnumType;
|
||||
export declare function renameType(type: GraphQLScalarType, newTypeName: string): GraphQLScalarType;
|
||||
export declare function renameType(type: GraphQLInputObjectType, newTypeName: string): GraphQLInputObjectType;
|
||||
export declare function renameType(type: GraphQLNamedType, newTypeName: string): GraphQLNamedType;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { GraphQLDirective, GraphQLNamedType } from 'graphql';
|
||||
export declare function rewireTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>): {
|
||||
typeMap: Record<string, GraphQLNamedType>;
|
||||
directives: Array<GraphQLDirective>;
|
||||
};
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { GraphQLDirective, GraphQLNamedType } from 'graphql';
|
||||
export declare function rewireTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>): {
|
||||
typeMap: Record<string, GraphQLNamedType>;
|
||||
directives: Array<GraphQLDirective>;
|
||||
};
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { ASTNode, GraphQLObjectType, GraphQLSchema, OperationTypeNode } from 'graphql';
|
||||
export declare function getDefinedRootType(schema: GraphQLSchema, operation: OperationTypeNode, nodes?: ASTNode[]): GraphQLObjectType;
|
||||
export declare const getRootTypeNames: (schema: GraphQLSchema) => Set<string>;
|
||||
export declare const getRootTypes: (schema: GraphQLSchema) => Set<GraphQLObjectType>;
|
||||
export declare const getRootTypeMap: (schema: GraphQLSchema) => Map<OperationTypeNode, GraphQLObjectType>;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { ASTNode, GraphQLObjectType, GraphQLSchema, OperationTypeNode } from 'graphql';
|
||||
export declare function getDefinedRootType(schema: GraphQLSchema, operation: OperationTypeNode, nodes?: ASTNode[]): GraphQLObjectType;
|
||||
export declare const getRootTypeNames: (schema: GraphQLSchema) => Set<string>;
|
||||
export declare const getRootTypes: (schema: GraphQLSchema) => Set<GraphQLObjectType>;
|
||||
export declare const getRootTypeMap: (schema: GraphQLSchema) => Map<OperationTypeNode, GraphQLObjectType>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { SelectionSetNode } from 'graphql';
|
||||
import { GraphQLParseOptions } from './Interfaces.cjs';
|
||||
export declare function parseSelectionSet(selectionSet: string, options?: GraphQLParseOptions): SelectionSetNode;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { SelectionSetNode } from 'graphql';
|
||||
import { GraphQLParseOptions } from './Interfaces.js';
|
||||
export declare function parseSelectionSet(selectionSet: string, options?: GraphQLParseOptions): SelectionSetNode;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user