Socket
Socket
Sign inDemoInstall

@graphql-tools/utils

Package Overview
Dependencies
2
Maintainers
3
Versions
1202
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.1-alpha-5b99152.0 to 5.0.1-alpha-63acff1.0

errors.d.ts

8

filterSchema.d.ts

@@ -1,8 +0,8 @@

import { GraphQLType } from 'graphql';
import { GraphQLSchemaWithTransforms, RootFieldFilter } from './Interfaces';
import { GraphQLType, GraphQLSchema } from 'graphql';
import { RootFieldFilter } from './Interfaces';
export declare function filterSchema({ schema, rootFieldFilter, typeFilter, fieldFilter, }: {
schema: GraphQLSchemaWithTransforms;
schema: GraphQLSchema;
rootFieldFilter?: RootFieldFilter;
typeFilter?: (typeName: string, type: GraphQLType) => boolean;
fieldFilter?: (typeName: string, fieldName: string) => boolean;
}): GraphQLSchemaWithTransforms;
}): GraphQLSchema;
import { ASTNode } from 'graphql';
export declare const asArray: <T>(fns: T | T[]) => T[];
export declare function chainFunctions(funcs: any[]): any;
export declare function isEqual<T>(a: T, b: T): boolean;

@@ -5,0 +4,0 @@ export declare function isNotEqual<T>(a: T, b: T): boolean;

@@ -12,3 +12,2 @@ export * from './loaders';

export * from './validate-documents';
export * from './resolvers-composition';
export * from './fix-schema-ast';

@@ -31,6 +30,6 @@ export * from './parse-graphql-json';

export * from './map';
export * from './rewire';
export * from './mergeDeep';
export * from './Interfaces';
export * from './fieldNodes';
export * from './resolveFromParentTypename';
export * from './stub';

@@ -47,1 +46,2 @@ export * from './fragments';

export * from './implementsAbstractType';
export * from './errors';

@@ -1,5 +0,3 @@

import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLFieldResolver, GraphQLResolveInfo, GraphQLIsTypeOfFn, GraphQLTypeResolver, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, InlineFragmentNode, GraphQLOutputType, SelectionSetNode, GraphQLDirective, GraphQLFieldConfig, FragmentDefinitionNode, SelectionNode, VariableDefinitionNode, OperationDefinitionNode, GraphQLError, ExecutionResult as GraphQLExecutionResult, BuildSchemaOptions } from 'graphql';
import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLFieldResolver, GraphQLResolveInfo, GraphQLIsTypeOfFn, GraphQLTypeResolver, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, InlineFragmentNode, SelectionSetNode, GraphQLDirective, GraphQLFieldConfig, FragmentDefinitionNode, SelectionNode, VariableDefinitionNode, OperationDefinitionNode, GraphQLError, ExecutionResult as GraphQLExecutionResult } from 'graphql';
import { SchemaVisitor } from './SchemaVisitor';
import { SchemaDirectiveVisitor } from './SchemaDirectiveVisitor';
export declare type SchemaDirectiveVisitorClass = typeof SchemaDirectiveVisitor;
export interface ExecutionResult<TData = Record<string, any>> extends GraphQLExecutionResult {

@@ -76,89 +74,2 @@ data?: TData | null;

};
declare module 'graphql' {
interface GraphQLResolveInfo {
mergeInfo?: MergeInfo;
}
}
export interface ExecutionParams<TArgs = Record<string, any>, TContext = any> {
document: DocumentNode;
variables?: TArgs;
context?: TContext;
info?: GraphQLResolveInfo;
}
export declare type AsyncExecutor = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = Record<string, any>>(params: ExecutionParams<TArgs, TContext>) => Promise<ExecutionResult<TReturn>>;
export declare type SyncExecutor = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = Record<string, any>>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn>;
export declare type Executor = AsyncExecutor | SyncExecutor;
export declare type Subscriber = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = Record<string, any>>(params: ExecutionParams<TArgs, TContext>) => Promise<AsyncIterator<ExecutionResult<TReturn>> | ExecutionResult<TReturn>>;
export interface SubschemaConfig {
schema: GraphQLSchema;
rootValue?: Record<string, any>;
executor?: Executor;
subscriber?: Subscriber;
createProxyingResolver?: CreateProxyingResolverFn;
transforms?: Array<Transform>;
merge?: Record<string, MergedTypeConfig>;
}
export interface MergedTypeConfig {
selectionSet?: string;
fieldName?: string;
args?: (originalResult: any) => Record<string, any>;
resolve?: MergedTypeResolver;
}
export declare type MergedTypeResolver = (originalResult: any, context: Record<string, any>, info: GraphQLResolveInfo, subschema: GraphQLSchema | SubschemaConfig, selectionSet: SelectionSetNode) => any;
export interface GraphQLSchemaWithTransforms extends GraphQLSchema {
transforms?: Array<Transform>;
}
export declare type MergeTypeCandidate = {
type: GraphQLNamedType;
schema?: GraphQLSchema;
subschema?: GraphQLSchema | SubschemaConfig;
transformedSubschema?: GraphQLSchema;
};
export declare type MergeTypeFilter = (mergeTypeCandidates: Array<MergeTypeCandidate>, typeName: string) => boolean;
export interface IMakeRemoteExecutableSchemaOptions {
schema: GraphQLSchema | string;
executor?: Executor;
subscriber?: Subscriber;
createResolver?: (executor: Executor, subscriber: Subscriber) => GraphQLFieldResolver<any, any>;
buildSchemaOptions?: BuildSchemaOptions;
}
export interface IStitchSchemasOptions {
subschemas?: Array<GraphQLSchema | SubschemaConfig>;
types?: Array<GraphQLNamedType>;
typeDefs?: string | DocumentNode;
schemas?: Array<SchemaLikeObject>;
onTypeConflict?: OnTypeConflict;
resolvers?: IResolversParameter;
schemaDirectives?: Record<string, SchemaDirectiveVisitorClass>;
inheritResolversFromInterfaces?: boolean;
mergeTypes?: boolean | Array<string> | MergeTypeFilter;
mergeDirectives?: boolean;
queryTypeName?: string;
mutationTypeName?: string;
subscriptionTypeName?: string;
}
export declare type SchemaLikeObject = SubschemaConfig | GraphQLSchema | string | DocumentNode | Array<GraphQLNamedType>;
export declare function isSubschemaConfig(value: SchemaLikeObject): value is SubschemaConfig;
export interface IDelegateToSchemaOptions<TContext = Record<string, any>, TArgs = Record<string, any>> {
schema: GraphQLSchema | SubschemaConfig;
operation?: Operation;
fieldName?: string;
returnType?: GraphQLOutputType;
args?: TArgs;
selectionSet?: SelectionSetNode;
fieldNodes?: ReadonlyArray<FieldNode>;
context?: TContext;
info: GraphQLResolveInfo;
rootValue?: Record<string, any>;
transforms?: Array<Transform>;
skipValidation?: boolean;
skipTypeMerging?: boolean;
}
export interface ICreateRequestFromInfo {
info: GraphQLResolveInfo;
operation: Operation;
fieldName: string;
selectionSet?: SelectionSetNode;
fieldNodes?: ReadonlyArray<FieldNode>;
}
export interface ICreateRequest {

@@ -176,16 +87,2 @@ sourceSchema?: GraphQLSchema;

}
export interface IDelegateRequestOptions extends IDelegateToSchemaOptions {
request: Request;
}
export interface MergeInfo {
delegate: (type: 'query' | 'mutation' | 'subscription', fieldName: string, args: Record<string, any>, context: Record<string, any>, info: GraphQLResolveInfo, transforms?: Array<Transform>) => any;
fragments: Array<{
field: string;
fragment: string;
}>;
replacementSelectionSets: ReplacementSelectionSetMapping;
replacementFragments: ReplacementFragmentMapping;
mergedTypes: Record<string, MergedTypeInfo>;
delegateToSchema<TContext, TArgs>(options: IDelegateToSchemaOptions<TContext, TArgs>): any;
}
export interface ReplacementSelectionSetMapping {

@@ -201,11 +98,2 @@ [typeName: string]: {

}
export interface MergedTypeInfo {
subschemas: Array<SubschemaConfig>;
selectionSet?: SelectionSetNode;
uniqueFields: Record<string, SubschemaConfig>;
nonUniqueFields: Record<string, Array<SubschemaConfig>>;
typeMaps: Map<SubschemaConfig, TypeMap>;
selectionSets: Map<SubschemaConfig, SelectionSetNode>;
containsSelectionSet: Map<SubschemaConfig, Map<SelectionSetNode, boolean>>;
}
export declare type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn;

@@ -219,17 +107,2 @@ export declare type ITypedef = (() => Array<ITypedef>) | string | DocumentNode;

export declare type IResolvers<TSource = any, TContext = any> = Record<string, (() => any) | IResolverObject<TSource, TContext> | IResolverOptions<TSource, TContext> | GraphQLScalarType | IEnumResolver>;
export declare type IResolversParameter = Array<IResolvers | ((mergeInfo: MergeInfo) => IResolvers)> | IResolvers | ((mergeInfo: MergeInfo) => IResolvers);
export interface ILogger {
log: (error: Error) => void;
}
export interface IExecutableSchemaDefinition<TContext = any> {
typeDefs: ITypeDefinitions;
resolvers?: IResolvers<any, TContext> | Array<IResolvers<any, TContext>>;
logger?: ILogger;
allowUndefinedInResolve?: boolean;
resolverValidationOptions?: IResolverValidationOptions;
directiveResolvers?: IDirectiveResolvers<any, TContext>;
schemaDirectives?: Record<string, SchemaDirectiveVisitorClass>;
parseOptions?: GraphQLParseOptions;
inheritResolversFromInterfaces?: boolean;
}
export declare type IFieldIteratorFn = (fieldDef: GraphQLField<any, any>, typeName: string, fieldName: string) => void;

@@ -244,10 +117,2 @@ export declare type IDefaultValueIteratorFn = (type: GraphQLInputType, value: any) => void;

}
export declare type OnTypeConflict = (left: GraphQLNamedType, right: GraphQLNamedType, info?: {
left: {
schema?: GraphQLSchema | SubschemaConfig;
};
right: {
schema?: GraphQLSchema | SubschemaConfig;
};
}) => GraphQLNamedType;
export declare type Operation = 'query' | 'mutation' | 'subscription';

@@ -343,2 +208,1 @@ export interface Request {

export declare type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined;
export declare type CreateProxyingResolverFn = (schema: GraphQLSchema | SubschemaConfig, transforms: Array<Transform>, operation: Operation, fieldName: string) => GraphQLFieldResolver<any, any>;
import { DocumentNode, GraphQLSchema, ParseOptions, BuildSchemaOptions } from 'graphql';
import { GraphQLSchemaValidationOptions } from 'graphql/type/schema';
export declare class Source {
export interface Source {
document?: DocumentNode;

@@ -8,7 +8,2 @@ schema?: GraphQLSchema;

location?: string;
constructor({ document, location, schema }: {
document?: DocumentNode;
location?: string;
schema?: GraphQLSchema;
});
}

@@ -15,0 +10,0 @@ export declare type SingleFileOptions = ParseOptions & GraphQLSchemaValidationOptions & BuildSchemaOptions & {

@@ -1,7 +0,3 @@

import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql';
import { GraphQLSchema } from 'graphql';
import { SchemaMapper } from './Interfaces';
export declare function mapSchema(schema: GraphQLSchema, schemaMapper?: SchemaMapper): GraphQLSchema;
export declare function rewireTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>): {
typeMap: Record<string, GraphQLNamedType>;
directives: Array<GraphQLDirective>;
};
{
"name": "@graphql-tools/utils",
"version": "5.0.1-alpha-5b99152.0",
"version": "5.0.1-alpha-63acff1.0",
"description": "Common package containting utils and types for GraphQL tools",

@@ -9,5 +9,3 @@ "peerDependencies": {

"dependencies": {
"aggregate-error": "3.0.1",
"camel-case": "4.1.1",
"lodash": "4.17.15"
"camel-case": "4.1.1"
},

@@ -24,5 +22,5 @@ "repository": "git@github.com:ardatan/graphql-tools.git",

"devDependencies": {
"@types/aggregate-error": "1.0.1",
"graphql-scalars": "1.1.2",
"iterall": "1.3.0"
"@types/dateformat": "3.0.1",
"dateformat": "3.0.3",
"graphql-scalars": "1.1.2"
},

@@ -29,0 +27,0 @@ "publishConfig": {

import { GraphQLDirective, GraphQLSchema } from 'graphql';
import { VisitableSchemaType, SchemaDirectiveVisitorClass } from './Interfaces';
import { VisitableSchemaType } from './Interfaces';
import { SchemaVisitor } from './SchemaVisitor';
export declare type SchemaDirectiveVisitorClass = typeof SchemaDirectiveVisitor;
export declare class SchemaDirectiveVisitor<TArgs = any, TContext = any> extends SchemaVisitor {

@@ -5,0 +6,0 @@ name: string;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc