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

@graphitation/supermassive

Package Overview
Dependencies
Maintainers
0
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphitation/supermassive - npm Package Compare versions

Comparing version 3.8.0-alpha.3 to 3.8.0-alpha.4

hooks.md

8

CHANGELOG.md
# Change Log - @graphitation/supermassive
<!-- This log was last generated on Tue, 17 Dec 2024 19:43:04 GMT and should not be manually modified. -->
<!-- This log was last generated on Wed, 25 Dec 2024 21:18:54 GMT and should not be manually modified. -->
<!-- Start content -->
## 3.8.0-alpha.3
## 3.8.0-alpha.4
Tue, 17 Dec 2024 19:43:04 GMT
Wed, 25 Dec 2024 21:18:54 GMT
### Changes
- subscribe hooks fixed (77059398+vejrj@users.noreply.github.com)
- Supermassive PR comment fixes (77059398+vejrj@users.noreply.github.com)

@@ -15,0 +15,0 @@ ## 3.7.2

@@ -1,3 +0,4 @@

import type { GraphQLError, OperationDefinitionNode } from "graphql";
import type { OperationDefinitionNode } from "graphql";
import type { ResolveInfo, TotalExecutionResult } from "../types";
import { PromiseOrValue } from "../jsutils/PromiseOrValue";
interface BaseExecuteHookArgs<ResolveContext> {

@@ -34,33 +35,92 @@ context: ResolveContext;

export interface BeforeFieldResolveHook<ResolveContext = unknown, BeforeHookContext = unknown> {
(args: BaseExecuteFieldHookArgs<ResolveContext>): Promise<BeforeHookContext> | BeforeHookContext | GraphQLError;
(args: BaseExecuteFieldHookArgs<ResolveContext>): PromiseOrValue<BeforeHookContext> | PromiseOrValue<Error>;
}
/**
* Represents a user in the system.
*/
export interface BeforeFieldSubscribe<ResolveContext = unknown, BeforeHookContext = unknown> {
(args: BaseExecuteFieldHookArgs<ResolveContext>): Promise<BeforeHookContext> | BeforeHookContext;
(args: BaseExecuteFieldHookArgs<ResolveContext>): PromiseOrValue<BeforeHookContext> | PromiseOrValue<Error>;
}
export interface AfterFieldResolveHook<ResolveContext = unknown, BeforeHookContext = unknown, AfterHookContext = BeforeHookContext> {
(args: AfterFieldResolveHookArgs<ResolveContext, BeforeHookContext>): AfterHookContext | GraphQLError;
(args: AfterFieldResolveHookArgs<ResolveContext, BeforeHookContext>): AfterHookContext | Error;
}
export interface AfterFieldSubscribe<ResolveContext = unknown, BeforeHookContext = unknown, AfterHookContext = BeforeHookContext> {
(args: AfterFieldSubscribeHookArgs<ResolveContext, BeforeHookContext>): AfterHookContext | GraphQLError;
(args: AfterFieldSubscribeHookArgs<ResolveContext, BeforeHookContext>): AfterHookContext | Error;
}
export interface AfterFieldCompleteHook<ResolveContext = unknown, AfterHookContext = unknown> {
(args: AfterFieldCompleteHookArgs<ResolveContext, AfterHookContext>): void | GraphQLError;
(args: AfterFieldCompleteHookArgs<ResolveContext, AfterHookContext>): void | Error;
}
export interface AfterBuildResponseHook<ResolveContext = unknown> {
(args: AfterBuildResponseHookArgs<ResolveContext>): void | GraphQLError;
(args: AfterBuildResponseHookArgs<ResolveContext>): void | Error;
}
export interface BeforeOperationExecuteHook<ResolveContext = unknown> {
(args: BaseExecuteOperationHookArgs<ResolveContext>): void | Promise<void> | GraphQLError;
(args: BaseExecuteOperationHookArgs<ResolveContext>): PromiseOrValue<void> | PromiseOrValue<Error>;
}
export interface BeforeSubscriptionEventEmitHook<ResolveContext = unknown> {
(args: BeforeSubscriptionEventEmitHookArgs<ResolveContext>): void | Promise<void> | GraphQLError;
(args: BeforeSubscriptionEventEmitHookArgs<ResolveContext>): PromiseOrValue<void> | PromiseOrValue<Error>;
}
export interface ExecutionHooks<ResolveContext = unknown, BeforeHookContext = unknown, AfterHookContext = BeforeHookContext> {
/**
* Called before every operation.
*
* @hook
* @throws {Error} Stops execution and sets `data` to `null` and registers the error.
* @returns {Error} The error is registered and execution continues.
*/
beforeOperationExecute?: BeforeOperationExecuteHook<ResolveContext>;
/**
* Called before every subscription event emit.
*
* @hook
* @throws {Error} Sets `data` to `null` and registers the error.
* @returns {Error} The error is registered and execution continues.
*/
beforeSubscriptionEventEmit?: BeforeSubscriptionEventEmitHook<ResolveContext>;
/**
* Called before every field resolution.
*
* @hook
* @throws {Error} The field is not executed and is handled as if it has returned `null`.
* @returns {Error} The error is registered and execution continues.
*/
beforeFieldResolve?: BeforeFieldResolveHook<ResolveContext, BeforeHookContext>;
/**
* Called before subscription event stream creation.
*
* @hook
* @throws {Error} Stops execution and sets `data` to `undefined` and error is returned in `errors` field.
* @returns {Error} Stops execution and sets `data` to `undefined` and error is returned in `errors` field.
*/
beforeFieldSubscribe?: BeforeFieldSubscribe<ResolveContext, BeforeHookContext>;
/**
* Called after every field resolution.
*
* @hook
* @throws {Error} The field is set to `null` and the error is registered.
* @returns {Error} The error is registered and execution continues.
*/
afterFieldResolve?: AfterFieldResolveHook<ResolveContext, BeforeHookContext, AfterHookContext>;
/**
* Called after subscription event stream creation.
*
* @hook
* @throws {Error} Stops execution and sets `data` to `undefined` and error is returned in `errors` field.
* @returns {Error} Stops execution and sets `data` to `undefined` and error is returned in `errors` field.
*/
afterFieldSubscribe?: AfterFieldSubscribe<ResolveContext, BeforeHookContext, AfterHookContext>;
/**
* Called when field value is completed.
*
* @hook
* @throws {Error} The field is set to `null` and the error is registered.
* @returns {Error} The error is registered and execution continues.
*/
afterFieldComplete?: AfterFieldCompleteHook<ResolveContext, AfterHookContext>;
/**
* Called after the response is built.
*
* @hook
* @throws {Error} Returns no data property, only errors.
* @returns {Error} The error is registered and execution continues.
*/
afterBuildResponse?: AfterBuildResponseHook<ResolveContext>;

@@ -67,0 +127,0 @@ }

{
"name": "@graphitation/supermassive",
"license": "MIT",
"version": "3.8.0-alpha.3",
"version": "3.8.0-alpha.4",
"main": "./lib/index",

@@ -6,0 +6,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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