@graphql-tools/utils 10.6.2 → 10.6.3

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.
Files changed (62) hide show
  1. package/cjs/Path.js +3 -4
  2. package/cjs/addTypes.js +1 -2
  3. package/cjs/astFromType.js +1 -2
  4. package/cjs/astFromValue.js +1 -2
  5. package/cjs/astFromValueUntyped.js +1 -2
  6. package/cjs/build-operation-for-field.js +1 -2
  7. package/cjs/collectFields.js +6 -6
  8. package/cjs/comments.js +10 -11
  9. package/cjs/createDeferred.js +1 -2
  10. package/cjs/debugTimer.js +2 -3
  11. package/cjs/descriptionFromObject.js +1 -2
  12. package/cjs/errors.js +2 -3
  13. package/cjs/extractExtensionsFromSchema.js +1 -2
  14. package/cjs/fakePromise.js +2 -3
  15. package/cjs/fields.js +4 -5
  16. package/cjs/filterSchema.js +1 -2
  17. package/cjs/fixSchemaAst.js +1 -2
  18. package/cjs/forEachDefaultValue.js +1 -2
  19. package/cjs/forEachField.js +1 -2
  20. package/cjs/get-arguments-with-directives.js +1 -2
  21. package/cjs/get-directives.js +4 -5
  22. package/cjs/get-fields-with-directives.js +1 -2
  23. package/cjs/get-implementing-types.js +1 -2
  24. package/cjs/getArgumentValues.js +1 -2
  25. package/cjs/getDirectiveExtensions.js +1 -2
  26. package/cjs/getObjectTypeFromTypeMap.js +1 -2
  27. package/cjs/getOperationASTFromRequest.js +2 -2
  28. package/cjs/getResolversFromSchema.js +1 -2
  29. package/cjs/getResponseKeyFromInfo.js +1 -2
  30. package/cjs/heal.js +2 -3
  31. package/cjs/helpers.js +8 -8
  32. package/cjs/implementsAbstractType.js +1 -2
  33. package/cjs/isAsyncIterable.js +1 -2
  34. package/cjs/isDocumentNode.js +1 -2
  35. package/cjs/jsutils.js +5 -6
  36. package/cjs/map-maybe-promise.js +1 -2
  37. package/cjs/mapAsyncIterator.js +1 -2
  38. package/cjs/mapSchema.js +2 -3
  39. package/cjs/memoize.js +7 -8
  40. package/cjs/mergeDeep.js +1 -2
  41. package/cjs/mergeIncrementalResult.js +1 -2
  42. package/cjs/observableToAsyncIterable.js +1 -2
  43. package/cjs/parse-graphql-json.js +1 -2
  44. package/cjs/parse-graphql-sdl.js +3 -4
  45. package/cjs/print-schema-with-directives.js +18 -19
  46. package/cjs/prune.js +1 -2
  47. package/cjs/renameType.js +1 -2
  48. package/cjs/rewire.js +1 -2
  49. package/cjs/rootTypes.js +2 -2
  50. package/cjs/selectionSets.js +1 -2
  51. package/cjs/stub.js +4 -5
  52. package/cjs/transformInputValue.js +4 -5
  53. package/cjs/updateArgument.js +2 -3
  54. package/cjs/validate-documents.js +2 -3
  55. package/cjs/valueMatchesCriteria.js +1 -2
  56. package/cjs/visitResult.js +3 -4
  57. package/cjs/withCancel.js +3 -4
  58. package/package.json +1 -1
  59. package/typings/Interfaces.d.cts +5 -1
  60. package/typings/Interfaces.d.ts +5 -1
  61. package/typings/getResponseKeyFromInfo.d.cts +1 -1
  62. package/typings/getResponseKeyFromInfo.d.ts +1 -1
package/cjs/Path.js CHANGED
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printPathArray = exports.pathToArray = exports.addPath = void 0;
3
+ exports.addPath = addPath;
4
+ exports.pathToArray = pathToArray;
5
+ exports.printPathArray = printPathArray;
4
6
  /**
5
7
  * Given a Path and a key, return a new Path containing the new key.
6
8
  */
7
9
  function addPath(prev, key, typename) {
8
10
  return { prev, key, typename };
9
11
  }
10
- exports.addPath = addPath;
11
12
  /**
12
13
  * Given a Path, return an Array of the path keys.
13
14
  */
@@ -20,7 +21,6 @@ function pathToArray(path) {
20
21
  }
21
22
  return flattened.reverse();
22
23
  }
23
- exports.pathToArray = pathToArray;
24
24
  /**
25
25
  * Build a string describing the path.
26
26
  */
@@ -29,4 +29,3 @@ function printPathArray(path) {
29
29
  .map(key => (typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key))
30
30
  .join('');
31
31
  }
32
- exports.printPathArray = printPathArray;
package/cjs/addTypes.js CHANGED
@@ -27,7 +27,7 @@
27
27
  // enhanceSchema can fill this gap by adding an additional round of rewiring.
28
28
  //
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.addTypes = void 0;
30
+ exports.addTypes = addTypes;
31
31
  const graphql_1 = require("graphql");
32
32
  const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js");
33
33
  const rewire_js_1 = require("./rewire.js");
@@ -59,4 +59,3 @@ function addTypes(schema, newTypesOrDirectives) {
59
59
  directives,
60
60
  });
61
61
  }
62
- exports.addTypes = addTypes;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.astFromType = void 0;
3
+ exports.astFromType = astFromType;
4
4
  const cross_inspect_1 = require("cross-inspect");
5
5
  const graphql_1 = require("graphql");
6
6
  function astFromType(type) {
@@ -28,4 +28,3 @@ function astFromType(type) {
28
28
  },
29
29
  };
30
30
  }
31
- exports.astFromType = astFromType;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.astFromValue = void 0;
3
+ exports.astFromValue = astFromValue;
4
4
  const cross_inspect_1 = require("cross-inspect");
5
5
  const graphql_1 = require("graphql");
6
6
  const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js");
@@ -100,7 +100,6 @@ function astFromValue(value, type) {
100
100
  // Not reachable, all possible types have been considered.
101
101
  console.assert(false, 'Unexpected input type: ' + (0, cross_inspect_1.inspect)(type));
102
102
  }
103
- exports.astFromValue = astFromValue;
104
103
  /**
105
104
  * IntValue:
106
105
  * - NegativeSign? 0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.astFromValueUntyped = void 0;
3
+ exports.astFromValueUntyped = astFromValueUntyped;
4
4
  const graphql_1 = require("graphql");
5
5
  /**
6
6
  * Produces a GraphQL Value AST given a JavaScript object.
@@ -76,7 +76,6 @@ function astFromValueUntyped(value) {
76
76
  }
77
77
  throw new TypeError(`Cannot convert value to AST: ${value}.`);
78
78
  }
79
- exports.astFromValueUntyped = astFromValueUntyped;
80
79
  /**
81
80
  * IntValue:
82
81
  * - NegativeSign? 0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildOperationNodeForField = void 0;
3
+ exports.buildOperationNodeForField = buildOperationNodeForField;
4
4
  const graphql_1 = require("graphql");
5
5
  const rootTypes_js_1 = require("./rootTypes.js");
6
6
  let operationVariables = [];
@@ -36,7 +36,6 @@ function buildOperationNodeForField({ schema, kind, field, models, ignore = [],
36
36
  resetFieldMap();
37
37
  return operationNode;
38
38
  }
39
- exports.buildOperationNodeForField = buildOperationNodeForField;
40
39
  function buildOperationAndCollectVariables({ schema, fieldName, kind, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, rootTypeNames, }) {
41
40
  const type = (0, rootTypes_js_1.getDefinedRootType)(schema, kind);
42
41
  const field = type.getFields()[fieldName];
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.collectSubFields = exports.getDeferValues = exports.getFieldEntryKey = exports.doesFragmentConditionMatch = exports.shouldIncludeNode = exports.collectFields = void 0;
3
+ exports.collectSubFields = void 0;
4
+ exports.collectFields = collectFields;
5
+ exports.shouldIncludeNode = shouldIncludeNode;
6
+ exports.doesFragmentConditionMatch = doesFragmentConditionMatch;
7
+ exports.getFieldEntryKey = getFieldEntryKey;
8
+ exports.getDeferValues = getDeferValues;
4
9
  const graphql_1 = require("graphql");
5
10
  const AccumulatorMap_js_1 = require("./AccumulatorMap.js");
6
11
  const directives_js_1 = require("./directives.js");
@@ -80,7 +85,6 @@ function collectFields(schema, fragments, variableValues, runtimeType, selection
80
85
  collectFieldsImpl(schema, fragments, variableValues, runtimeType, selectionSet, fields, patches, new Set());
81
86
  return { fields, patches };
82
87
  }
83
- exports.collectFields = collectFields;
84
88
  /**
85
89
  * Determines if a field should be included based on the `@include` and `@skip`
86
90
  * directives, where `@skip` has higher precedence than `@include`.
@@ -96,7 +100,6 @@ function shouldIncludeNode(variableValues, node) {
96
100
  }
97
101
  return true;
98
102
  }
99
- exports.shouldIncludeNode = shouldIncludeNode;
100
103
  /**
101
104
  * Determines if a fragment is applicable to the given type.
102
105
  */
@@ -115,14 +118,12 @@ function doesFragmentConditionMatch(schema, fragment, type) {
115
118
  }
116
119
  return false;
117
120
  }
118
- exports.doesFragmentConditionMatch = doesFragmentConditionMatch;
119
121
  /**
120
122
  * Implements the logic to compute the key of a given field's entry
121
123
  */
122
124
  function getFieldEntryKey(node) {
123
125
  return node.alias ? node.alias.value : node.name.value;
124
126
  }
125
- exports.getFieldEntryKey = getFieldEntryKey;
126
127
  /**
127
128
  * Returns an object containing the `@defer` arguments if a field should be
128
129
  * deferred based on the experimental flag, defer directive present and
@@ -140,7 +141,6 @@ function getDeferValues(variableValues, node) {
140
141
  label: typeof defer['label'] === 'string' ? defer['label'] : undefined,
141
142
  };
142
143
  }
143
- exports.getDeferValues = getDeferValues;
144
144
  /**
145
145
  * Given an array of field nodes, collects all of the subfields of the passed
146
146
  * in fields, and returns them at the end.
package/cjs/comments.js CHANGED
@@ -1,13 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBlockStringIndentation = exports.dedentBlockStringValue = exports.getLeadingCommentBlock = exports.getComment = exports.getDescription = exports.printWithComments = exports.printComment = exports.pushComment = exports.collectComment = exports.resetComments = void 0;
3
+ exports.resetComments = resetComments;
4
+ exports.collectComment = collectComment;
5
+ exports.pushComment = pushComment;
6
+ exports.printComment = printComment;
7
+ exports.printWithComments = printWithComments;
8
+ exports.getDescription = getDescription;
9
+ exports.getComment = getComment;
10
+ exports.getLeadingCommentBlock = getLeadingCommentBlock;
11
+ exports.dedentBlockStringValue = dedentBlockStringValue;
12
+ exports.getBlockStringIndentation = getBlockStringIndentation;
4
13
  const graphql_1 = require("graphql");
5
14
  const MAX_LINE_LENGTH = 80;
6
15
  let commentsRegistry = {};
7
16
  function resetComments() {
8
17
  commentsRegistry = {};
9
18
  }
10
- exports.resetComments = resetComments;
11
19
  function collectComment(node) {
12
20
  const entityName = node.name?.value;
13
21
  if (entityName == null) {
@@ -38,7 +46,6 @@ function collectComment(node) {
38
46
  break;
39
47
  }
40
48
  }
41
- exports.collectComment = collectComment;
42
49
  function pushComment(node, entity, field, argument) {
43
50
  const comment = getComment(node);
44
51
  if (typeof comment !== 'string' || comment.length === 0) {
@@ -57,11 +64,9 @@ function pushComment(node, entity, field, argument) {
57
64
  }
58
65
  commentsRegistry[path].push(comment);
59
66
  }
60
- exports.pushComment = pushComment;
61
67
  function printComment(comment) {
62
68
  return '\n# ' + comment.replace(/\n/g, '\n# ');
63
69
  }
64
- exports.printComment = printComment;
65
70
  /**
66
71
  * Copyright (c) 2015-present, Facebook, Inc.
67
72
  *
@@ -306,7 +311,6 @@ const printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((p
306
311
  function printWithComments(ast) {
307
312
  return (0, graphql_1.visit)(ast, printDocASTReducerWithComments);
308
313
  }
309
- exports.printWithComments = printWithComments;
310
314
  function isFieldDefinitionNode(node) {
311
315
  return node.kind === 'FieldDefinition';
312
316
  }
@@ -319,14 +323,12 @@ function getDescription(node, options) {
319
323
  return getComment(node);
320
324
  }
321
325
  }
322
- exports.getDescription = getDescription;
323
326
  function getComment(node) {
324
327
  const rawValue = getLeadingCommentBlock(node);
325
328
  if (rawValue !== undefined) {
326
329
  return dedentBlockStringValue(`\n${rawValue}`);
327
330
  }
328
331
  }
329
- exports.getComment = getComment;
330
332
  function getLeadingCommentBlock(node) {
331
333
  const loc = node.loc;
332
334
  if (!loc) {
@@ -346,7 +348,6 @@ function getLeadingCommentBlock(node) {
346
348
  }
347
349
  return comments.length > 0 ? comments.reverse().join('\n') : undefined;
348
350
  }
349
- exports.getLeadingCommentBlock = getLeadingCommentBlock;
350
351
  function dedentBlockStringValue(rawString) {
351
352
  // Expand a block string's raw value into independent lines.
352
353
  const lines = rawString.split(/\r\n|[\n\r]/g);
@@ -367,7 +368,6 @@ function dedentBlockStringValue(rawString) {
367
368
  // Return a string of the lines joined with U+000A.
368
369
  return lines.join('\n');
369
370
  }
370
- exports.dedentBlockStringValue = dedentBlockStringValue;
371
371
  /**
372
372
  * @internal
373
373
  */
@@ -388,7 +388,6 @@ function getBlockStringIndentation(lines) {
388
388
  }
389
389
  return commonIndent === null ? 0 : commonIndent;
390
390
  }
391
- exports.getBlockStringIndentation = getBlockStringIndentation;
392
391
  function leadingWhitespace(str) {
393
392
  let i = 0;
394
393
  while (i < str.length && (str[i] === ' ' || str[i] === '\t')) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDeferred = void 0;
3
+ exports.createDeferred = createDeferred;
4
4
  function createDeferred() {
5
5
  if (Promise.withResolvers) {
6
6
  return Promise.withResolvers();
@@ -13,4 +13,3 @@ function createDeferred() {
13
13
  });
14
14
  return { promise, resolve, reject };
15
15
  }
16
- exports.createDeferred = createDeferred;
package/cjs/debugTimer.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debugTimerEnd = exports.debugTimerStart = void 0;
3
+ exports.debugTimerStart = debugTimerStart;
4
+ exports.debugTimerEnd = debugTimerEnd;
4
5
  const debugNamesOngoing = new Set();
5
6
  function debugTimerStart(name) {
6
7
  const debugEnvVar = globalThis.process?.env?.['DEBUG'] || globalThis.DEBUG;
@@ -9,10 +10,8 @@ function debugTimerStart(name) {
9
10
  console.time(name);
10
11
  }
11
12
  }
12
- exports.debugTimerStart = debugTimerStart;
13
13
  function debugTimerEnd(name) {
14
14
  if (debugNamesOngoing.has(name)) {
15
15
  console.timeEnd(name);
16
16
  }
17
17
  }
18
- exports.debugTimerEnd = debugTimerEnd;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDescriptionNode = void 0;
3
+ exports.getDescriptionNode = getDescriptionNode;
4
4
  const graphql_1 = require("graphql");
5
5
  function getDescriptionNode(obj) {
6
6
  if (obj.astNode?.description) {
@@ -17,4 +17,3 @@ function getDescriptionNode(obj) {
17
17
  };
18
18
  }
19
19
  }
20
- exports.getDescriptionNode = getDescriptionNode;
package/cjs/errors.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.relocatedError = exports.createGraphQLError = void 0;
3
+ exports.createGraphQLError = createGraphQLError;
4
+ exports.relocatedError = relocatedError;
4
5
  const graphql_1 = require("graphql");
5
6
  const possibleGraphQLErrorProperties = [
6
7
  'message',
@@ -30,7 +31,6 @@ function createGraphQLError(message, options) {
30
31
  }
31
32
  return new graphql_1.GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
32
33
  }
33
- exports.createGraphQLError = createGraphQLError;
34
34
  function relocatedError(originalError, path) {
35
35
  return createGraphQLError(originalError.message, {
36
36
  nodes: originalError.nodes,
@@ -41,4 +41,3 @@ function relocatedError(originalError, path) {
41
41
  extensions: originalError.extensions,
42
42
  });
43
43
  }
44
- exports.relocatedError = relocatedError;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractExtensionsFromSchema = void 0;
3
+ exports.extractExtensionsFromSchema = extractExtensionsFromSchema;
4
4
  const helpers_js_1 = require("./helpers.js");
5
5
  const Interfaces_js_1 = require("./Interfaces.js");
6
6
  const mapSchema_js_1 = require("./mapSchema.js");
@@ -100,4 +100,3 @@ function extractExtensionsFromSchema(schema, removeDirectives = false) {
100
100
  });
101
101
  return result;
102
102
  }
103
- exports.extractExtensionsFromSchema = extractExtensionsFromSchema;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fakePromise = exports.fakeRejectPromise = void 0;
3
+ exports.fakeRejectPromise = fakeRejectPromise;
4
+ exports.fakePromise = fakePromise;
4
5
  function isPromise(val) {
5
6
  return val?.then != null;
6
7
  }
@@ -27,7 +28,6 @@ function fakeRejectPromise(error) {
27
28
  [Symbol.toStringTag]: 'Promise',
28
29
  };
29
30
  }
30
- exports.fakeRejectPromise = fakeRejectPromise;
31
31
  function fakePromise(value) {
32
32
  if (isPromise(value)) {
33
33
  return value;
@@ -61,4 +61,3 @@ function fakePromise(value) {
61
61
  [Symbol.toStringTag]: 'Promise',
62
62
  };
63
63
  }
64
- exports.fakePromise = fakePromise;
package/cjs/fields.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modifyObjectFields = exports.selectObjectFields = exports.removeObjectFields = exports.appendObjectFields = void 0;
3
+ exports.appendObjectFields = appendObjectFields;
4
+ exports.removeObjectFields = removeObjectFields;
5
+ exports.selectObjectFields = selectObjectFields;
6
+ exports.modifyObjectFields = modifyObjectFields;
4
7
  const graphql_1 = require("graphql");
5
8
  const addTypes_js_1 = require("./addTypes.js");
6
9
  const Interfaces_js_1 = require("./Interfaces.js");
@@ -34,7 +37,6 @@ function appendObjectFields(schema, typeName, additionalFields) {
34
37
  },
35
38
  });
36
39
  }
37
- exports.appendObjectFields = appendObjectFields;
38
40
  function removeObjectFields(schema, typeName, testFn) {
39
41
  const removedFields = {};
40
42
  const newSchema = (0, mapSchema_js_1.mapSchema)(schema, {
@@ -61,7 +63,6 @@ function removeObjectFields(schema, typeName, testFn) {
61
63
  });
62
64
  return [newSchema, removedFields];
63
65
  }
64
- exports.removeObjectFields = removeObjectFields;
65
66
  function selectObjectFields(schema, typeName, testFn) {
66
67
  const selectedFields = {};
67
68
  (0, mapSchema_js_1.mapSchema)(schema, {
@@ -81,7 +82,6 @@ function selectObjectFields(schema, typeName, testFn) {
81
82
  });
82
83
  return selectedFields;
83
84
  }
84
- exports.selectObjectFields = selectObjectFields;
85
85
  function modifyObjectFields(schema, typeName, testFn, newFields) {
86
86
  const removedFields = {};
87
87
  const newSchema = (0, mapSchema_js_1.mapSchema)(schema, {
@@ -112,4 +112,3 @@ function modifyObjectFields(schema, typeName, testFn, newFields) {
112
112
  });
113
113
  return [newSchema, removedFields];
114
114
  }
115
- exports.modifyObjectFields = modifyObjectFields;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterSchema = void 0;
3
+ exports.filterSchema = filterSchema;
4
4
  const graphql_1 = require("graphql");
5
5
  const Interfaces_js_1 = require("./Interfaces.js");
6
6
  const mapSchema_js_1 = require("./mapSchema.js");
@@ -26,7 +26,6 @@ function filterSchema({ schema, typeFilter = () => true, fieldFilter = undefined
26
26
  });
27
27
  return filteredSchema;
28
28
  }
29
- exports.filterSchema = filterSchema;
30
29
  function filterRootFields(type, operation, rootFieldFilter, argumentFilter) {
31
30
  if (rootFieldFilter || argumentFilter) {
32
31
  const config = type.toConfig();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fixSchemaAst = void 0;
3
+ exports.fixSchemaAst = fixSchemaAst;
4
4
  const graphql_1 = require("graphql");
5
5
  const print_schema_with_directives_js_1 = require("./print-schema-with-directives.js");
6
6
  function buildFixedSchema(schema, options) {
@@ -23,4 +23,3 @@ function fixSchemaAst(schema, options) {
23
23
  }
24
24
  return schema;
25
25
  }
26
- exports.fixSchemaAst = fixSchemaAst;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forEachDefaultValue = void 0;
3
+ exports.forEachDefaultValue = forEachDefaultValue;
4
4
  const graphql_1 = require("graphql");
5
5
  function forEachDefaultValue(schema, fn) {
6
6
  const typeMap = schema.getTypeMap();
@@ -26,4 +26,3 @@ function forEachDefaultValue(schema, fn) {
26
26
  }
27
27
  }
28
28
  }
29
- exports.forEachDefaultValue = forEachDefaultValue;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forEachField = void 0;
3
+ exports.forEachField = forEachField;
4
4
  const graphql_1 = require("graphql");
5
5
  function forEachField(schema, fn) {
6
6
  const typeMap = schema.getTypeMap();
@@ -16,4 +16,3 @@ function forEachField(schema, fn) {
16
16
  }
17
17
  }
18
18
  }
19
- exports.forEachField = forEachField;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getArgumentsWithDirectives = void 0;
3
+ exports.getArgumentsWithDirectives = getArgumentsWithDirectives;
4
4
  const graphql_1 = require("graphql");
5
5
  function isTypeWithFields(t) {
6
6
  return t.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION || t.kind === graphql_1.Kind.OBJECT_TYPE_EXTENSION;
@@ -29,4 +29,3 @@ function getArgumentsWithDirectives(documentNode) {
29
29
  }
30
30
  return result;
31
31
  }
32
- exports.getArgumentsWithDirectives = getArgumentsWithDirectives;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDirective = exports.getDirectives = exports.getDirectiveInExtensions = exports.getDirectivesInExtensions = void 0;
3
+ exports.getDirectivesInExtensions = getDirectivesInExtensions;
4
+ exports.getDirectiveInExtensions = getDirectiveInExtensions;
5
+ exports.getDirectives = getDirectives;
6
+ exports.getDirective = getDirective;
4
7
  const getDirectiveExtensions_js_1 = require("./getDirectiveExtensions.js");
5
8
  function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ['directives']) {
6
9
  const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, undefined, pathToDirectivesInExtensions);
@@ -12,12 +15,10 @@ function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ['direct
12
15
  .flat(Infinity)
13
16
  .filter(Boolean);
14
17
  }
15
- exports.getDirectivesInExtensions = getDirectivesInExtensions;
16
18
  function getDirectiveInExtensions(node, directiveName, pathToDirectivesInExtensions = ['directives']) {
17
19
  const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, undefined, pathToDirectivesInExtensions);
18
20
  return directiveExtensions[directiveName];
19
21
  }
20
- exports.getDirectiveInExtensions = getDirectiveInExtensions;
21
22
  function getDirectives(schema, node, pathToDirectivesInExtensions = ['directives']) {
22
23
  const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, schema, pathToDirectivesInExtensions);
23
24
  return Object.entries(directiveExtensions)
@@ -28,9 +29,7 @@ function getDirectives(schema, node, pathToDirectivesInExtensions = ['directives
28
29
  .flat(Infinity)
29
30
  .filter(Boolean);
30
31
  }
31
- exports.getDirectives = getDirectives;
32
32
  function getDirective(schema, node, directiveName, pathToDirectivesInExtensions = ['directives']) {
33
33
  const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, schema, pathToDirectivesInExtensions);
34
34
  return directiveExtensions[directiveName];
35
35
  }
36
- exports.getDirective = getDirective;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFieldsWithDirectives = void 0;
3
+ exports.getFieldsWithDirectives = getFieldsWithDirectives;
4
4
  const graphql_1 = require("graphql");
5
5
  function getFieldsWithDirectives(documentNode, options = {}) {
6
6
  const result = {};
@@ -28,4 +28,3 @@ function getFieldsWithDirectives(documentNode, options = {}) {
28
28
  }
29
29
  return result;
30
30
  }
31
- exports.getFieldsWithDirectives = getFieldsWithDirectives;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getImplementingTypes = void 0;
3
+ exports.getImplementingTypes = getImplementingTypes;
4
4
  function getImplementingTypes(interfaceName, schema) {
5
5
  const allTypesMap = schema.getTypeMap();
6
6
  const result = [];
@@ -15,4 +15,3 @@ function getImplementingTypes(interfaceName, schema) {
15
15
  }
16
16
  return result;
17
17
  }
18
- exports.getImplementingTypes = getImplementingTypes;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getArgumentValues = void 0;
3
+ exports.getArgumentValues = getArgumentValues;
4
4
  const cross_inspect_1 = require("cross-inspect");
5
5
  const graphql_1 = require("graphql");
6
6
  const errors_js_1 = require("./errors.js");
@@ -69,4 +69,3 @@ function getArgumentValues(def, node, variableValues = {}) {
69
69
  }
70
70
  return coercedValues;
71
71
  }
72
- exports.getArgumentValues = getArgumentValues;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDirectiveExtensions = void 0;
3
+ exports.getDirectiveExtensions = getDirectiveExtensions;
4
4
  const graphql_1 = require("graphql");
5
5
  const getArgumentValues_js_1 = require("./getArgumentValues.js");
6
6
  const memoize_js_1 = require("./memoize.js");
@@ -84,4 +84,3 @@ function getDirectiveExtensions(directableObj, schema, pathToDirectivesInExtensi
84
84
  }
85
85
  return directiveExtensions;
86
86
  }
87
- exports.getDirectiveExtensions = getDirectiveExtensions;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getObjectTypeFromTypeMap = void 0;
3
+ exports.getObjectTypeFromTypeMap = getObjectTypeFromTypeMap;
4
4
  const graphql_1 = require("graphql");
5
5
  function getObjectTypeFromTypeMap(typeMap, type) {
6
6
  if (type) {
@@ -10,4 +10,3 @@ function getObjectTypeFromTypeMap(typeMap, type) {
10
10
  }
11
11
  }
12
12
  }
13
- exports.getObjectTypeFromTypeMap = getObjectTypeFromTypeMap;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOperationASTFromRequest = exports.getOperationASTFromDocument = void 0;
3
+ exports.getOperationASTFromRequest = void 0;
4
+ exports.getOperationASTFromDocument = getOperationASTFromDocument;
4
5
  const graphql_1 = require("graphql");
5
6
  const memoize_js_1 = require("./memoize.js");
6
7
  function getOperationASTFromDocument(documentNode, operationName) {
@@ -10,7 +11,6 @@ function getOperationASTFromDocument(documentNode, operationName) {
10
11
  }
11
12
  return doc;
12
13
  }
13
- exports.getOperationASTFromDocument = getOperationASTFromDocument;
14
14
  exports.getOperationASTFromRequest = (0, memoize_js_1.memoize1)(function getOperationASTFromRequest(request) {
15
15
  return getOperationASTFromDocument(request.document, request.operationName);
16
16
  });
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getResolversFromSchema = void 0;
3
+ exports.getResolversFromSchema = getResolversFromSchema;
4
4
  const graphql_1 = require("graphql");
5
5
  function getResolversFromSchema(schema,
6
6
  // Include default merged resolvers
@@ -69,4 +69,3 @@ includeDefaultMergedResolver) {
69
69
  }
70
70
  return resolvers;
71
71
  }
72
- exports.getResolversFromSchema = getResolversFromSchema;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getResponseKeyFromInfo = void 0;
3
+ exports.getResponseKeyFromInfo = getResponseKeyFromInfo;
4
4
  /**
5
5
  * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just
6
6
  * resolves aliases.
@@ -9,4 +9,3 @@ exports.getResponseKeyFromInfo = void 0;
9
9
  function getResponseKeyFromInfo(info) {
10
10
  return info.fieldNodes[0].alias != null ? info.fieldNodes[0].alias.value : info.fieldName;
11
11
  }
12
- exports.getResponseKeyFromInfo = getResponseKeyFromInfo;
package/cjs/heal.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.healTypes = exports.healSchema = void 0;
3
+ exports.healSchema = healSchema;
4
+ exports.healTypes = healTypes;
4
5
  const graphql_1 = require("graphql");
5
6
  // Update any references to named schema types that disagree with the named
6
7
  // types found in schema.getTypeMap().
@@ -34,7 +35,6 @@ function healSchema(schema) {
34
35
  healTypes(schema.getTypeMap(), schema.getDirectives());
35
36
  return schema;
36
37
  }
37
- exports.healSchema = healSchema;
38
38
  function healTypes(originalTypeMap, directives) {
39
39
  const actualNamedTypeMap = Object.create(null);
40
40
  // If any of the .name properties of the GraphQLNamedType objects in
@@ -175,4 +175,3 @@ function healTypes(originalTypeMap, directives) {
175
175
  return type;
176
176
  }
177
177
  }
178
- exports.healTypes = healTypes;