@envelop/core 1.7.0 → 1.8.0-alpha-0107392.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -477,13 +477,20 @@ function createEnvelopOrchestrator(plugins) {
477
477
  const afterCalls = [];
478
478
  try {
479
479
  let context = orchestratorCtx ? { ...initialContext, ...orchestratorCtx } : initialContext;
480
+ let shortCircuitContext;
480
481
  for (const onContext of beforeCallbacks.context) {
481
482
  const afterHookResult = await onContext({
482
483
  context,
483
484
  extendContext: extension => {
484
485
  context = { ...context, ...extension };
485
486
  },
487
+ shortCircuitContext: value => {
488
+ shortCircuitContext = value;
489
+ },
486
490
  });
491
+ if (shortCircuitContext !== undefined) {
492
+ break;
493
+ }
487
494
  if (typeof afterHookResult === 'function') {
488
495
  afterCalls.push(afterHookResult);
489
496
  }
package/index.mjs CHANGED
@@ -473,13 +473,20 @@ function createEnvelopOrchestrator(plugins) {
473
473
  const afterCalls = [];
474
474
  try {
475
475
  let context = orchestratorCtx ? { ...initialContext, ...orchestratorCtx } : initialContext;
476
+ let shortCircuitContext;
476
477
  for (const onContext of beforeCallbacks.context) {
477
478
  const afterHookResult = await onContext({
478
479
  context,
479
480
  extendContext: extension => {
480
481
  context = { ...context, ...extension };
481
482
  },
483
+ shortCircuitContext: value => {
484
+ shortCircuitContext = value;
485
+ },
482
486
  });
487
+ if (shortCircuitContext !== undefined) {
488
+ break;
489
+ }
483
490
  if (typeof afterHookResult === 'function') {
484
491
  afterCalls.push(afterHookResult);
485
492
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@envelop/core",
3
- "version": "1.7.0",
3
+ "version": "1.8.0-alpha-0107392.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
7
7
  },
8
8
  "dependencies": {
9
- "@envelop/types": "1.5.1"
9
+ "@envelop/types": "1.6.0-alpha-0107392.0"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -0,0 +1,2 @@
1
+ import type { Plugin } from '@envelop/types';
2
+ export declare const useFastIntrospection: () => Plugin;