@graphql-tools/utils
Advanced tools
Comparing version 5.0.1-alpha-cf46456.0 to 5.0.1-alpha-d0ee15c.0
@@ -1,4 +0,3 @@ | ||
import { GraphQLFieldConfigMap, GraphQLFieldConfig } from 'graphql'; | ||
import { TypeMap } from './Interfaces'; | ||
export declare function appendFields(typeMap: TypeMap, typeName: string, fields: GraphQLFieldConfigMap<any, any>): void; | ||
export declare function removeFields(typeMap: TypeMap, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): GraphQLFieldConfigMap<any, any>; | ||
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>]; |
@@ -28,3 +28,4 @@ export * from './loaders'; | ||
export * from './forEachDefaultValue'; | ||
export * from './map'; | ||
export * from './mapSchema'; | ||
export * from './addTypes'; | ||
export * from './rewire'; | ||
@@ -31,0 +32,0 @@ export * from './mergeDeep'; |
@@ -1,2 +0,2 @@ | ||
import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLFieldResolver, GraphQLResolveInfo, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, SelectionSetNode, GraphQLDirective, FragmentDefinitionNode, SelectionNode, VariableDefinitionNode, OperationDefinitionNode, GraphQLError, ExecutionResult as GraphQLExecutionResult, GraphQLOutputType, FieldDefinitionNode } from 'graphql'; | ||
import { GraphQLSchema, GraphQLField, GraphQLInputType, GraphQLNamedType, GraphQLFieldResolver, GraphQLResolveInfo, GraphQLScalarType, DocumentNode, FieldNode, GraphQLEnumValue, GraphQLEnumType, GraphQLUnionType, GraphQLArgument, GraphQLInputField, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLDirective, FragmentDefinitionNode, SelectionNode, OperationDefinitionNode, GraphQLError, ExecutionResult as GraphQLExecutionResult, GraphQLOutputType, FieldDefinitionNode, GraphQLFieldConfig, GraphQLInputFieldConfig } from 'graphql'; | ||
import { SchemaVisitor } from './SchemaVisitor'; | ||
@@ -78,4 +78,4 @@ export interface ExecutionResult<TData = Record<string, any>> extends GraphQLExecutionResult { | ||
export declare type FieldNodeMappers = Record<string, Record<string, FieldNodeMapper>>; | ||
export declare type FieldFilter = (typeName?: string, fieldName?: string, field?: GraphQLField<any, any>) => boolean; | ||
export declare type RootFieldFilter = (operation?: 'Query' | 'Mutation' | 'Subscription', rootFieldName?: string, field?: GraphQLField<any, any>) => boolean; | ||
export declare type FieldFilter = (typeName?: string, fieldName?: string, fieldConfig?: GraphQLFieldConfig<any, any>) => boolean; | ||
export declare type RootFieldFilter = (operation?: 'Query' | 'Mutation' | 'Subscription', rootFieldName?: string, fieldConfig?: GraphQLFieldConfig<any, any>) => boolean; | ||
export declare type RenameTypesOptions = { | ||
@@ -85,14 +85,2 @@ renameBuiltins: boolean; | ||
}; | ||
export interface ICreateRequest { | ||
sourceSchema?: GraphQLSchema; | ||
sourceParentType?: GraphQLObjectType; | ||
sourceFieldName?: string; | ||
fragments?: Record<string, FragmentDefinitionNode>; | ||
variableDefinitions?: ReadonlyArray<VariableDefinitionNode>; | ||
variableValues?: Record<string, any>; | ||
targetOperation: Operation; | ||
targetFieldName: string; | ||
selectionSet?: SelectionSetNode; | ||
fieldNodes?: ReadonlyArray<FieldNode>; | ||
} | ||
export declare type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn; | ||
@@ -218,3 +206,12 @@ export declare type ITypedef = (() => Array<ITypedef>) | string | DocumentNode; | ||
SUBSCRIPTION = "MapperKind.SUBSCRIPTION", | ||
DIRECTIVE = "MapperKind.DIRECTIVE" | ||
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" | ||
} | ||
@@ -236,2 +233,10 @@ export interface SchemaMapper { | ||
[MapperKind.DIRECTIVE]?: DirectiveMapper; | ||
[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.INPUT_OBJECT_FIELD]?: InputFieldMapper; | ||
} | ||
@@ -248,2 +253,5 @@ export declare type NamedTypeMapper = (type: GraphQLNamedType, schema: GraphQLSchema) => GraphQLNamedType | null | undefined; | ||
export declare type DirectiveMapper = (directive: GraphQLDirective, schema: GraphQLSchema) => GraphQLDirective | null | undefined; | ||
export declare type GenericFieldMapper<F extends GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig> = (fieldConfig: F, fieldName: string, typeName: string, schema: GraphQLSchema) => F | [string, F] | null | undefined; | ||
export declare type FieldMapper = GenericFieldMapper<GraphQLFieldConfig<any, any>>; | ||
export declare type InputFieldMapper = GenericFieldMapper<GraphQLInputFieldConfig>; | ||
export {}; |
{ | ||
"name": "@graphql-tools/utils", | ||
"version": "5.0.1-alpha-cf46456.0", | ||
"version": "5.0.1-alpha-d0ee15c.0", | ||
"description": "Common package containting utils and types for GraphQL tools", | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
import { GraphQLDirective, GraphQLNamedType } from 'graphql'; | ||
import { TypeMap } from './Interfaces'; | ||
export declare function rewireTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>, options?: { | ||
skipPruning: boolean; | ||
}): { | ||
typeMap: Record<string, GraphQLNamedType>; | ||
typeMap: TypeMap; | ||
directives: Array<GraphQLDirective>; | ||
}; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
749678
54
6703
0