New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@envelop/types

Package Overview
Dependencies
Maintainers
1
Versions
665
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 1.5.0 to 1.5.1

5

hooks.d.ts
import type { DocumentNode, ExecutionArgs, ExecutionResult, GraphQLError, GraphQLResolveInfo, GraphQLSchema, ParseOptions, Source, SubscriptionArgs, ValidationRule } from 'graphql';
import { Maybe, PromiseOrValue } from './utils';
import { Maybe, PromiseOrValue, AsyncIterableIteratorOrValue } from './utils';
import { DefaultContext } from './context-types';
import { AsyncIterableIteratorOrValue, ExecuteFunction, ParseFunction, ValidateFunction, ValidateFunctionParameter } from '@envelop/core';
import { SubscribeFunction } from './graphql';
import { ExecuteFunction, ParseFunction, ValidateFunction, ValidateFunctionParameter, SubscribeFunction } from './graphql';
import { Plugin } from './plugin';

@@ -7,0 +6,0 @@ export declare type DefaultArgs = Record<string, unknown>;

1

index.d.ts

@@ -7,2 +7,1 @@ export * from './context-types';

export * from './utils';
export * from './async-utils';
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/**
* Returns true if the provided object implements the AsyncIterator protocol via
* implementing a `Symbol.asyncIterator` method.
*
* Source: https://github.com/graphql/graphql-js/blob/main/src/jsutils/isAsyncIterable.ts
*/
function isAsyncIterable(maybeAsyncIterable) {
return (maybeAsyncIterable != null &&
typeof maybeAsyncIterable === 'object' &&
typeof maybeAsyncIterable[Symbol.asyncIterator] === 'function');
}
/**
* A utility function for hanlding `onExecuteDone` hook result, for simplifying the hanlding of AsyncIterable returned from `execute`.
*
* @param payload The payload send to `onExecuteDone` hook function
* @param fn The handler to be executed on each result
* @returns a subscription for streamed results, or undefined in case of an non-async
*/
function handleStreamOrSingleExecutionResult(payload, fn) {
if (isAsyncIterable(payload.result)) {
return { onNext: fn };
}
else {
fn({
args: payload.args,
result: payload.result,
setResult: payload.setResult,
});
return undefined;
}
}
exports.handleStreamOrSingleExecutionResult = handleStreamOrSingleExecutionResult;
exports.isAsyncIterable = isAsyncIterable;
{
"name": "@envelop/types",
"version": "1.5.0",
"version": "1.5.1",
"sideEffects": false,

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

@@ -1,3 +0,2 @@

import { OnEnvelopedHook } from '@envelop/core';
import { OnContextBuildingHook, OnExecuteHook, OnParseHook, OnPluginInitHook, OnSchemaChangeHook, OnSubscribeHook, OnValidateHook } from './hooks';
import { OnEnvelopedHook, OnContextBuildingHook, OnExecuteHook, OnParseHook, OnPluginInitHook, OnSchemaChangeHook, OnSubscribeHook, OnValidateHook } from './hooks';
export interface Plugin<PluginContext extends Record<string, any> = {}> {

@@ -4,0 +3,0 @@ /**

Sorry, the diff of this file is not supported yet

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