@graphql-tools/schema 9.0.10 → 9.0.11-alpha-20221114133606-dae9ff99
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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addResolversToSchema = void 0;
|
|
3
|
+
exports.createNewSchemaWithResolvers = exports.addResolversToExistingSchema = exports.addResolversToSchema = void 0;
|
|
4
4
|
const graphql_1 = require("graphql");
|
|
5
5
|
const utils_1 = require("@graphql-tools/utils");
|
|
6
6
|
const checkForResolveTypeResolver_js_1 = require("./checkForResolveTypeResolver.js");
|
|
@@ -188,6 +188,7 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
|
|
|
188
188
|
}
|
|
189
189
|
return schema;
|
|
190
190
|
}
|
|
191
|
+
exports.addResolversToExistingSchema = addResolversToExistingSchema;
|
|
191
192
|
function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
|
|
192
193
|
schema = (0, utils_1.mapSchema)(schema, {
|
|
193
194
|
[utils_1.MapperKind.SCALAR_TYPE]: type => {
|
|
@@ -311,6 +312,7 @@ function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
|
|
|
311
312
|
}
|
|
312
313
|
return schema;
|
|
313
314
|
}
|
|
315
|
+
exports.createNewSchemaWithResolvers = createNewSchemaWithResolvers;
|
|
314
316
|
function setFieldProperties(field, propertiesObj) {
|
|
315
317
|
for (const propertyName in propertiesObj) {
|
|
316
318
|
field[propertyName] = propertiesObj[propertyName];
|
|
@@ -81,7 +81,7 @@ export function addResolversToSchema({ schema, resolvers: inputResolvers, defaul
|
|
|
81
81
|
}
|
|
82
82
|
return schema;
|
|
83
83
|
}
|
|
84
|
-
function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
|
|
84
|
+
export function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
|
|
85
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
86
86
|
const typeMap = schema.getTypeMap();
|
|
87
87
|
for (const typeName in resolvers) {
|
|
@@ -184,7 +184,7 @@ function addResolversToExistingSchema(schema, resolvers, defaultFieldResolver) {
|
|
|
184
184
|
}
|
|
185
185
|
return schema;
|
|
186
186
|
}
|
|
187
|
-
function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
|
|
187
|
+
export function createNewSchemaWithResolvers(schema, resolvers, defaultFieldResolver) {
|
|
188
188
|
schema = mapSchema(schema, {
|
|
189
189
|
[MapperKind.SCALAR_TYPE]: type => {
|
|
190
190
|
var _a, _b, _c, _d, _e, _f;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/schema",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.11-alpha-20221114133606-dae9ff99",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-tools/merge": "8.3.
|
|
11
|
-
"@graphql-tools/utils": "9.1.
|
|
10
|
+
"@graphql-tools/merge": "8.3.13-alpha-20221114133606-dae9ff99",
|
|
11
|
+
"@graphql-tools/utils": "9.1.2-alpha-20221114133606-dae9ff99",
|
|
12
12
|
"tslib": "^2.4.0",
|
|
13
13
|
"value-or-promise": "1.0.11"
|
|
14
14
|
},
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { IAddResolversToSchemaOptions } from '@graphql-tools/utils';
|
|
1
|
+
import { GraphQLSchema, GraphQLFieldResolver } from 'graphql';
|
|
2
|
+
import { IResolvers, IAddResolversToSchemaOptions } from '@graphql-tools/utils';
|
|
3
3
|
export declare function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, }: IAddResolversToSchemaOptions): GraphQLSchema;
|
|
4
|
+
export declare function addResolversToExistingSchema(schema: GraphQLSchema, resolvers: IResolvers, defaultFieldResolver?: GraphQLFieldResolver<any, any>): GraphQLSchema;
|
|
5
|
+
export declare function createNewSchemaWithResolvers(schema: GraphQLSchema, resolvers: IResolvers, defaultFieldResolver?: GraphQLFieldResolver<any, any>): GraphQLSchema;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { IAddResolversToSchemaOptions } from '@graphql-tools/utils';
|
|
1
|
+
import { GraphQLSchema, GraphQLFieldResolver } from 'graphql';
|
|
2
|
+
import { IResolvers, IAddResolversToSchemaOptions } from '@graphql-tools/utils';
|
|
3
3
|
export declare function addResolversToSchema({ schema, resolvers: inputResolvers, defaultFieldResolver, resolverValidationOptions, inheritResolversFromInterfaces, updateResolversInPlace, }: IAddResolversToSchemaOptions): GraphQLSchema;
|
|
4
|
+
export declare function addResolversToExistingSchema(schema: GraphQLSchema, resolvers: IResolvers, defaultFieldResolver?: GraphQLFieldResolver<any, any>): GraphQLSchema;
|
|
5
|
+
export declare function createNewSchemaWithResolvers(schema: GraphQLSchema, resolvers: IResolvers, defaultFieldResolver?: GraphQLFieldResolver<any, any>): GraphQLSchema;
|