@envelop/core 2.4.1-alpha-ffbace6f.0 → 3.0.0-alpha-5b6bfa8.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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createEnvelopOrchestrator = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const traced_schema_js_1 = require("./traced-schema.js");
6
6
  const utils_js_1 = require("./utils.js");
7
7
  function createEnvelopOrchestrator(plugins) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useImmediateIntrospection = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const OnNonIntrospectionFieldReachedValidationRule = (onNonIntrospectionField) => ctx => {
6
6
  const rootQueryType = ctx.getSchema().getQueryType();
7
7
  const rootMutationType = ctx.getSchema().getMutationType();
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useMaskedErrors = exports.formatError = exports.EnvelopError = exports.DEFAULT_ERROR_MESSAGE = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const utils_js_1 = require("../utils.js");
6
6
  exports.DEFAULT_ERROR_MESSAGE = 'Unexpected error.';
7
7
  class EnvelopError extends graphql_1.GraphQLError {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useTiming = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const utils_js_1 = require("../utils.js");
6
6
  const HR_TO_NS = 1e9;
7
7
  const NS_TO_MS = 1e6;
@@ -2,7 +2,7 @@
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.traceOrchestrator = void 0;
5
- const graphql_1 = require("graphql");
5
+ const graphql_1 = require("@graphql-tools/graphql");
6
6
  const utils_js_1 = require("./utils.js");
7
7
  const getTimestamp = typeof globalThis !== 'undefined' && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.performance) === null || _a === void 0 ? void 0 : _a.now)
8
8
  ? () => globalThis.performance.now()
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareTracedSchema = exports.resolversHooksSymbol = exports.trackedSchemaSymbol = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  exports.trackedSchemaSymbol = Symbol('TRACKED_SCHEMA');
6
6
  exports.resolversHooksSymbol = Symbol('RESOLVERS_HOOKS');
7
7
  function prepareTracedSchema(schema) {
package/cjs/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.errorAsyncIterator = exports.finalAsyncIterator = exports.handleStreamOrSingleExecutionResult = exports.isAsyncIterable = exports.makeExecute = exports.mapAsyncIterator = exports.makeSubscribe = exports.isIntrospectionOperationString = exports.isIntrospectionDocument = exports.isIntrospectionOperation = exports.isOperationDefinition = exports.envelopIsIntrospectionSymbol = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  exports.envelopIsIntrospectionSymbol = Symbol('ENVELOP_IS_INTROSPECTION');
6
6
  function isOperationDefinition(def) {
7
7
  return def.kind === graphql_1.Kind.OPERATION_DEFINITION;
@@ -1,4 +1,4 @@
1
- import { execute, parse, specifiedRules, subscribe, validate, } from 'graphql';
1
+ import { execute, parse, specifiedRules, subscribe, validate, } from '@graphql-tools/graphql';
2
2
  import { prepareTracedSchema, resolversHooksSymbol } from './traced-schema.js';
3
3
  import { errorAsyncIterator, finalAsyncIterator, makeExecute, makeSubscribe, mapAsyncIterator, isAsyncIterable, } from './utils.js';
4
4
  export function createEnvelopOrchestrator(plugins) {
@@ -1,4 +1,4 @@
1
- import { BREAK } from 'graphql';
1
+ import { BREAK } from '@graphql-tools/graphql';
2
2
  const OnNonIntrospectionFieldReachedValidationRule = (onNonIntrospectionField) => ctx => {
3
3
  const rootQueryType = ctx.getSchema().getQueryType();
4
4
  const rootMutationType = ctx.getSchema().getMutationType();
@@ -1,4 +1,4 @@
1
- import { GraphQLError } from 'graphql';
1
+ import { GraphQLError } from '@graphql-tools/graphql';
2
2
  import { handleStreamOrSingleExecutionResult } from '../utils.js';
3
3
  export const DEFAULT_ERROR_MESSAGE = 'Unexpected error.';
4
4
  export class EnvelopError extends GraphQLError {
@@ -1,4 +1,4 @@
1
- import { getOperationAST } from 'graphql';
1
+ import { getOperationAST, } from '@graphql-tools/graphql';
2
2
  import { isIntrospectionOperationString, envelopIsIntrospectionSymbol } from '../utils.js';
3
3
  const HR_TO_NS = 1e9;
4
4
  const NS_TO_MS = 1e6;
@@ -1,5 +1,5 @@
1
1
  var _a;
2
- import { GraphQLSchema, } from 'graphql';
2
+ import { GraphQLSchema, } from '@graphql-tools/graphql';
3
3
  import { isAsyncIterable } from './utils.js';
4
4
  const getTimestamp = typeof globalThis !== 'undefined' && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.performance) === null || _a === void 0 ? void 0 : _a.now)
5
5
  ? () => globalThis.performance.now()
@@ -1,4 +1,4 @@
1
- import { defaultFieldResolver, isIntrospectionType, isObjectType } from 'graphql';
1
+ import { defaultFieldResolver, isIntrospectionType, isObjectType } from '@graphql-tools/graphql';
2
2
  export const trackedSchemaSymbol = Symbol('TRACKED_SCHEMA');
3
3
  export const resolversHooksSymbol = Symbol('RESOLVERS_HOOKS');
4
4
  export function prepareTracedSchema(schema) {
package/esm/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Kind, visit, BREAK, } from 'graphql';
1
+ import { Kind, visit, BREAK, } from '@graphql-tools/graphql';
2
2
  export const envelopIsIntrospectionSymbol = Symbol('ENVELOP_IS_INTROSPECTION');
3
3
  export function isOperationDefinition(def) {
4
4
  return def.kind === Kind.OPERATION_DEFINITION;
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "@envelop/core",
3
- "version": "2.4.1-alpha-ffbace6f.0",
3
+ "version": "3.0.0-alpha-5b6bfa8.0",
4
4
  "sideEffects": false,
5
- "peerDependencies": {
6
- "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
7
- },
8
5
  "dependencies": {
9
- "@envelop/types": "2.3.0"
6
+ "@envelop/types": "2.3.0",
7
+ "@graphql-tools/graphql": "0.1.0-alpha-33fb2950.0"
10
8
  },
11
9
  "repository": {
12
10
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  import { ArbitraryObject, EnvelopContextFnWrapper, GetEnvelopedFn, Plugin, DefaultContext, Maybe } from '@envelop/types';
2
- import { GraphQLSchema } from 'graphql';
2
+ import { GraphQLSchema } from '@graphql-tools/graphql';
3
3
  export declare type EnvelopOrchestrator<InitialContext extends ArbitraryObject = ArbitraryObject, PluginsContext extends ArbitraryObject = ArbitraryObject> = {
4
4
  init: (initialContext?: Maybe<InitialContext>) => void;
5
5
  parse: EnvelopContextFnWrapper<ReturnType<GetEnvelopedFn<PluginsContext>>['parse'], InitialContext>;
@@ -1,4 +1,4 @@
1
1
  import { Plugin, DefaultContext } from '@envelop/types';
2
- import { GraphQLError } from 'graphql';
2
+ import { GraphQLError } from '@graphql-tools/graphql';
3
3
  export declare type ErrorHandler = (errors: readonly GraphQLError[], context: Readonly<DefaultContext>) => void;
4
4
  export declare const useErrorHandler: <ContextType>(errorHandler: ErrorHandler) => Plugin<ContextType>;
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from '@envelop/types';
2
- import { GraphQLError, GraphQLErrorExtensions } from 'graphql';
2
+ import { GraphQLError, GraphQLErrorExtensions } from '@graphql-tools/graphql';
3
3
  export declare const DEFAULT_ERROR_MESSAGE = "Unexpected error.";
4
4
  export declare class EnvelopError extends GraphQLError {
5
5
  constructor(message: string, extensions?: GraphQLErrorExtensions);
@@ -1,4 +1,4 @@
1
1
  import { Plugin, TypedExecutionArgs } from '@envelop/types';
2
- import { ExecutionResult } from 'graphql';
2
+ import { ExecutionResult } from '@graphql-tools/graphql';
3
3
  export declare type FormatterFunction = (result: ExecutionResult<any, any>, args: TypedExecutionArgs<any>) => false | ExecutionResult<any, any>;
4
4
  export declare const usePayloadFormatter: (formatter: FormatterFunction) => Plugin;
@@ -1,4 +1,4 @@
1
- import { GraphQLSchema } from 'graphql';
1
+ import { GraphQLSchema } from '@graphql-tools/graphql';
2
2
  import { DefaultContext, Maybe, Plugin } from '@envelop/types';
3
3
  export declare const useSchema: (schema: GraphQLSchema) => Plugin;
4
4
  export declare const useLazyLoadedSchema: (schemaLoader: (context: Maybe<DefaultContext>) => GraphQLSchema) => Plugin;
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from '@envelop/types';
2
- import { DocumentNode, ExecutionArgs, GraphQLResolveInfo, Source, SubscriptionArgs } from 'graphql';
2
+ import { DocumentNode, ExecutionArgs, GraphQLResolveInfo, Source, SubscriptionArgs } from '@graphql-tools/graphql';
3
3
  import { envelopIsIntrospectionSymbol } from '../utils.js';
4
4
  export declare type ResultTiming = {
5
5
  ms: number;
@@ -1,4 +1,4 @@
1
- import { GraphQLSchema } from 'graphql';
1
+ import { GraphQLSchema } from '@graphql-tools/graphql';
2
2
  export declare const trackedSchemaSymbol: unique symbol;
3
3
  export declare const resolversHooksSymbol: unique symbol;
4
4
  export declare function prepareTracedSchema(schema: GraphQLSchema | null | undefined): void;
@@ -1,4 +1,4 @@
1
- import { ASTNode, DocumentNode, OperationDefinitionNode, Source, ExecutionResult, SubscriptionArgs, ExecutionArgs } from 'graphql';
1
+ import { ASTNode, DocumentNode, OperationDefinitionNode, Source, ExecutionResult, SubscriptionArgs, ExecutionArgs } from '@graphql-tools/graphql';
2
2
  import { AsyncIterableIteratorOrValue, ExecuteFunction, SubscribeFunction, PromiseOrValue, DefaultContext, OnExecuteDoneEventPayload, OnExecuteDoneHookResult, OnExecuteDoneHookResultOnNextHook } from '@envelop/types';
3
3
  export declare const envelopIsIntrospectionSymbol: unique symbol;
4
4
  export declare function isOperationDefinition(def: ASTNode): def is OperationDefinitionNode;