@graphql-tools/schema 10.0.0 → 10.0.1-rc-20231121170354-0e80c00a

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.
@@ -98,7 +98,8 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
98
98
  else if (fieldName === 'astNode' && type.astNode != null) {
99
99
  type.astNode = {
100
100
  ...type.astNode,
101
- description: resolverValue?.astNode?.description ?? type.astNode.description,
101
+ description: resolverValue?.astNode?.description ??
102
+ type.astNode.description,
102
103
  directives: (type.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
103
104
  };
104
105
  }
@@ -125,7 +126,8 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
125
126
  else if (fieldName === 'astNode' && config.astNode != null) {
126
127
  config.astNode = {
127
128
  ...config.astNode,
128
- description: resolverValue?.astNode?.description ?? config.astNode.description,
129
+ description: resolverValue?.astNode?.description ??
130
+ config.astNode.description,
129
131
  directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
130
132
  };
131
133
  }
@@ -200,7 +202,8 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
200
202
  else if (fieldName === 'astNode' && config.astNode != null) {
201
203
  config.astNode = {
202
204
  ...config.astNode,
203
- description: resolverValue?.astNode?.description ?? config.astNode.description,
205
+ description: resolverValue?.astNode?.description ??
206
+ config.astNode.description,
204
207
  directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
205
208
  };
206
209
  }
@@ -231,7 +234,8 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
231
234
  else if (fieldName === 'astNode' && config.astNode != null) {
232
235
  config.astNode = {
233
236
  ...config.astNode,
234
- description: resolverValue?.astNode?.description ?? config.astNode.description,
237
+ description: resolverValue?.astNode?.description ??
238
+ config.astNode.description,
235
239
  directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
236
240
  };
237
241
  }
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeExecutableSchema = void 0;
4
4
  const graphql_1 = require("graphql");
5
+ const merge_1 = require("@graphql-tools/merge");
5
6
  const utils_1 = require("@graphql-tools/utils");
6
7
  const addResolversToSchema_js_1 = require("./addResolversToSchema.js");
7
8
  const assertResolversPresent_js_1 = require("./assertResolversPresent.js");
8
- const merge_1 = require("@graphql-tools/merge");
9
9
  /**
10
10
  * Builds a schema from the provided type definitions and resolvers.
11
11
  *
@@ -1,5 +1,5 @@
1
- import { GraphQLEnumType, GraphQLScalarType, GraphQLUnionType, GraphQLInterfaceType, GraphQLObjectType, isSpecifiedScalarType, isScalarType, isEnumType, isUnionType, isInterfaceType, isObjectType, } from 'graphql';
2
- import { mapSchema, MapperKind, forEachDefaultValue, serializeInputValue, healSchema, parseInputValue, forEachField, } from '@graphql-tools/utils';
1
+ import { GraphQLEnumType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInterfaceType, isObjectType, isScalarType, isSpecifiedScalarType, isUnionType, } from 'graphql';
2
+ import { forEachDefaultValue, forEachField, healSchema, MapperKind, mapSchema, parseInputValue, serializeInputValue, } from '@graphql-tools/utils';
3
3
  import { checkForResolveTypeResolver } from './checkForResolveTypeResolver.js';
4
4
  import { extendResolversFromInterfaces } from './extendResolversFromInterfaces.js';
5
5
  export function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions = {}, inheritResolversFromInterfaces = false, updateResolversInPlace = false, }) {
@@ -94,7 +94,8 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
94
94
  else if (fieldName === 'astNode' && type.astNode != null) {
95
95
  type.astNode = {
96
96
  ...type.astNode,
97
- description: resolverValue?.astNode?.description ?? type.astNode.description,
97
+ description: resolverValue?.astNode?.description ??
98
+ type.astNode.description,
98
99
  directives: (type.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
99
100
  };
100
101
  }
@@ -121,7 +122,8 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
121
122
  else if (fieldName === 'astNode' && config.astNode != null) {
122
123
  config.astNode = {
123
124
  ...config.astNode,
124
- description: resolverValue?.astNode?.description ?? config.astNode.description,
125
+ description: resolverValue?.astNode?.description ??
126
+ config.astNode.description,
125
127
  directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
126
128
  };
127
129
  }
@@ -196,7 +198,8 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
196
198
  else if (fieldName === 'astNode' && config.astNode != null) {
197
199
  config.astNode = {
198
200
  ...config.astNode,
199
- description: resolverValue?.astNode?.description ?? config.astNode.description,
201
+ description: resolverValue?.astNode?.description ??
202
+ config.astNode.description,
200
203
  directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
201
204
  };
202
205
  }
@@ -227,7 +230,8 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
227
230
  else if (fieldName === 'astNode' && config.astNode != null) {
228
231
  config.astNode = {
229
232
  ...config.astNode,
230
- description: resolverValue?.astNode?.description ?? config.astNode.description,
233
+ description: resolverValue?.astNode?.description ??
234
+ config.astNode.description,
231
235
  directives: (config.astNode.directives ?? []).concat(resolverValue?.astNode?.directives ?? []),
232
236
  };
233
237
  }
@@ -1,8 +1,8 @@
1
1
  import { buildASTSchema, buildSchema, isSchema } from 'graphql';
2
+ import { applyExtensions, mergeExtensions, mergeResolvers, mergeTypeDefs, } from '@graphql-tools/merge';
2
3
  import { asArray } from '@graphql-tools/utils';
3
4
  import { addResolversToSchema } from './addResolversToSchema.js';
4
5
  import { assertResolversPresent } from './assertResolversPresent.js';
5
- import { applyExtensions, mergeExtensions, mergeResolvers, mergeTypeDefs } from '@graphql-tools/merge';
6
6
  /**
7
7
  * Builds a schema from the provided type definitions and resolvers.
8
8
  *
@@ -1,4 +1,4 @@
1
- import { asArray, getResolversFromSchema, extractExtensionsFromSchema, } from '@graphql-tools/utils';
1
+ import { asArray, extractExtensionsFromSchema, getResolversFromSchema, } from '@graphql-tools/utils';
2
2
  import { makeExecutableSchema } from './makeExecutableSchema.js';
3
3
  /**
4
4
  * Synchronously merges multiple schemas, typeDefinitions and/or resolvers into a single schema.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/schema",
3
- "version": "10.0.0",
3
+ "version": "10.0.1-rc-20231121170354-0e80c00a",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@graphql-tools/merge": "^9.0.0",
11
- "@graphql-tools/utils": "^10.0.0",
11
+ "@graphql-tools/utils": "10.0.9-rc-20231121170354-0e80c00a",
12
12
  "tslib": "^2.4.0",
13
13
  "value-or-promise": "^1.0.12"
14
14
  },
@@ -1,4 +1,4 @@
1
- import { GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql';
1
+ import { GraphQLFieldResolver, GraphQLResolveInfo } from 'graphql';
2
2
  import { Maybe } from '@graphql-tools/utils';
3
3
  export declare function chainResolvers<TArgs extends {
4
4
  [argName: string]: any;
@@ -1,4 +1,4 @@
1
- import { GraphQLResolveInfo, GraphQLFieldResolver } from 'graphql';
1
+ import { GraphQLFieldResolver, GraphQLResolveInfo } from 'graphql';
2
2
  import { Maybe } from '@graphql-tools/utils';
3
3
  export declare function chainResolvers<TArgs extends {
4
4
  [argName: string]: any;
@@ -1,5 +1,5 @@
1
- import { TypeSource, IResolvers, IResolverValidationOptions, GraphQLParseOptions, SchemaExtensions } from '@graphql-tools/utils';
2
1
  import { BuildSchemaOptions, GraphQLSchema } from 'graphql';
2
+ import { GraphQLParseOptions, IResolvers, IResolverValidationOptions, SchemaExtensions, TypeSource } from '@graphql-tools/utils';
3
3
  export interface GraphQLSchemaWithContext<TContext> extends GraphQLSchema {
4
4
  __context?: TContext;
5
5
  }
@@ -1,5 +1,5 @@
1
- import { TypeSource, IResolvers, IResolverValidationOptions, GraphQLParseOptions, SchemaExtensions } from '@graphql-tools/utils';
2
1
  import { BuildSchemaOptions, GraphQLSchema } from 'graphql';
2
+ import { GraphQLParseOptions, IResolvers, IResolverValidationOptions, SchemaExtensions, TypeSource } from '@graphql-tools/utils';
3
3
  export interface GraphQLSchemaWithContext<TContext> extends GraphQLSchema {
4
4
  __context?: TContext;
5
5
  }