@envelop/types
Advanced tools
Comparing version 0.1.4 to 0.1.5-alpha-7f6ce3b.0
@@ -1,2 +0,31 @@ | ||
import { DocumentNode, GraphQLSchema, Source, ParseOptions, GraphQLError, execute, parse, validate, GraphQLResolveInfo, ExecutionArgs, ExecutionResult, ValidationRule, TypeInfo, subscribe, SubscriptionArgs } from 'graphql'; | ||
import { DocumentNode, GraphQLSchema, Source, ParseOptions, GraphQLError, parse, validate, GraphQLResolveInfo, ExecutionArgs, ExecutionResult, ValidationRule, TypeInfo, SubscriptionArgs, GraphQLFieldResolver, GraphQLTypeResolver } from 'graphql'; | ||
import { Maybe } from 'graphql/jsutils/Maybe'; | ||
import { PromiseOrValue } from 'graphql/jsutils/PromiseOrValue'; | ||
export declare type PolymorphicExecuteArguments = [ExecutionArgs] | [ | ||
GraphQLSchema, | ||
DocumentNode, | ||
any, | ||
any, | ||
Maybe<{ | ||
[key: string]: any; | ||
}>, | ||
Maybe<string>, | ||
Maybe<GraphQLFieldResolver<any, any>>, | ||
Maybe<GraphQLTypeResolver<any, any>> | ||
]; | ||
export declare type ExecuteFunction = (...args: PolymorphicExecuteArguments) => PromiseOrValue<ExecutionResult>; | ||
export declare type PolymorphicSubscribeArguments = [SubscriptionArgs] | [ | ||
GraphQLSchema, | ||
DocumentNode, | ||
any?, | ||
any?, | ||
Maybe<{ | ||
[key: string]: any; | ||
}>?, | ||
Maybe<string>?, | ||
Maybe<GraphQLFieldResolver<any, any>>?, | ||
Maybe<GraphQLFieldResolver<any, any>>?, | ||
ExecuteFunction? | ||
]; | ||
export declare type SubscribeFunction = (...args: PolymorphicSubscribeArguments) => PromiseOrValue<AsyncIterableIterator<ExecutionResult> | ExecutionResult>; | ||
declare type AfterFnOrVoid<Result> = void | ((afterOptions: Result) => void); | ||
@@ -36,8 +65,10 @@ export declare type DefaultContext = Record<string, unknown>; | ||
onPluginInit?: (options: { | ||
addPlugin: (newPlugin: Plugin<any>) => void; | ||
plugins: Plugin[]; | ||
setSchema: (newSchema: GraphQLSchema) => void; | ||
}) => void; | ||
onExecute?: (options: { | ||
executeFn: typeof execute; | ||
executeFn: ExecuteFunction; | ||
args: ExecutionArgs; | ||
setExecuteFn: (newExecute: typeof execute) => void; | ||
setExecuteFn: (newExecute: ExecuteFunction) => void; | ||
setResultAndStopExecution: (newResult: ExecutionResult) => void; | ||
@@ -47,5 +78,5 @@ extendContext: (contextExtension: Partial<PluginContext>) => void; | ||
onSubscribe?: (options: { | ||
subscribeFn: typeof subscribe; | ||
subscribeFn: SubscribeFunction; | ||
args: SubscriptionArgs; | ||
setSubscribeFn: (newSubscribe: typeof subscribe) => void; | ||
setSubscribeFn: (newSubscribe: SubscribeFunction) => void; | ||
extendContext: (contextExtension: Partial<PluginContext>) => void; | ||
@@ -62,3 +93,3 @@ }) => void | OnSubscribeHookResult<PluginContext>; | ||
}, { | ||
result: DocumentNode | Error; | ||
result: DocumentNode | Error | null; | ||
replaceParseResult: (newResult: DocumentNode | Error) => void; | ||
@@ -91,8 +122,8 @@ }, false>; | ||
} | ||
export declare type AfterCallback<T extends keyof Plugin> = Plugin[T] extends BeforeAfterHook<infer B, infer A, infer Async> ? (afterOptions: A) => void : never; | ||
export declare type AfterCallback<T extends keyof Plugin<any>> = NonNullable<Plugin[T]> extends BeforeAfterHook<infer B, infer A, infer Async> ? (afterOptions: A) => void : never; | ||
export declare type Envelop<RequestContext = unknown, ExecutionContext = DefaultContext> = { | ||
(): { | ||
execute: typeof execute; | ||
execute: ExecuteFunction; | ||
validate: typeof validate; | ||
subscribe: typeof subscribe; | ||
subscribe: SubscribeFunction; | ||
parse: typeof parse; | ||
@@ -99,0 +130,0 @@ contextFactory: (requestContext: RequestContext) => ExecutionContext | Promise<ExecutionContext>; |
{ | ||
"name": "@envelop/types", | ||
"version": "0.1.4", | ||
"version": "0.1.5-alpha-7f6ce3b.0", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
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
6306
134