Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@envelop/types

Package Overview
Dependencies
Maintainers
1
Versions
629
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/types - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5-alpha-7f6ce3b.0

49

index.d.ts

@@ -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>;

2

package.json
{
"name": "@envelop/types",
"version": "0.1.4",
"version": "0.1.5-alpha-7f6ce3b.0",
"sideEffects": false,

@@ -5,0 +5,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc