@graphql-tools/utils 8.9.1-alpha-9d6b1e75.0 → 8.9.1-alpha-25f2d2c4.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.
Files changed (155) hide show
  1. package/cjs/addTypes.js +1 -1
  2. package/cjs/astFromType.js +1 -1
  3. package/cjs/astFromValueUntyped.js +1 -1
  4. package/cjs/build-operation-for-field.js +1 -1
  5. package/cjs/collectFields.js +1 -1
  6. package/cjs/comments.js +1 -1
  7. package/cjs/errors.js +1 -1
  8. package/cjs/fields.js +1 -1
  9. package/cjs/filterSchema.js +1 -1
  10. package/cjs/fixSchemaAst.js +1 -1
  11. package/cjs/forEachDefaultValue.js +1 -1
  12. package/cjs/forEachField.js +1 -1
  13. package/cjs/get-fields-with-directives.js +1 -1
  14. package/cjs/get-implementing-types.js +1 -1
  15. package/cjs/getArgumentValues.js +1 -1
  16. package/cjs/getObjectTypeFromTypeMap.js +1 -1
  17. package/cjs/getOperationASTFromRequest.js +1 -1
  18. package/cjs/getResolversFromSchema.js +1 -1
  19. package/cjs/heal.js +2 -1
  20. package/cjs/helpers.js +1 -1
  21. package/cjs/implementsAbstractType.js +1 -1
  22. package/cjs/inspect.js +1 -1
  23. package/cjs/isDocumentNode.js +1 -1
  24. package/cjs/mapSchema.js +1 -1
  25. package/cjs/parse-graphql-json.js +1 -1
  26. package/cjs/parse-graphql-sdl.js +1 -1
  27. package/cjs/print-schema-with-directives.js +1 -1
  28. package/cjs/prune.js +1 -1
  29. package/cjs/renameType.js +1 -1
  30. package/cjs/rewire.js +1 -1
  31. package/cjs/selectionSets.js +1 -1
  32. package/cjs/stub.js +2 -1
  33. package/cjs/transformInputValue.js +1 -1
  34. package/cjs/updateArgument.js +1 -1
  35. package/cjs/validate-documents.js +1 -1
  36. package/cjs/visitResult.js +1 -1
  37. package/esm/addTypes.js +1 -1
  38. package/esm/astFromType.js +1 -1
  39. package/esm/astFromValueUntyped.js +1 -1
  40. package/esm/build-operation-for-field.js +1 -1
  41. package/esm/collectFields.js +1 -1
  42. package/esm/comments.js +1 -1
  43. package/esm/errors.js +1 -1
  44. package/esm/fields.js +1 -1
  45. package/esm/filterSchema.js +1 -1
  46. package/esm/fixSchemaAst.js +1 -1
  47. package/esm/forEachDefaultValue.js +1 -1
  48. package/esm/forEachField.js +1 -1
  49. package/esm/get-fields-with-directives.js +1 -1
  50. package/esm/get-implementing-types.js +1 -1
  51. package/esm/getArgumentValues.js +1 -1
  52. package/esm/getObjectTypeFromTypeMap.js +1 -1
  53. package/esm/getOperationASTFromRequest.js +1 -1
  54. package/esm/getResolversFromSchema.js +1 -1
  55. package/esm/heal.js +2 -1
  56. package/esm/helpers.js +1 -1
  57. package/esm/implementsAbstractType.js +1 -1
  58. package/esm/inspect.js +1 -1
  59. package/esm/isDocumentNode.js +1 -1
  60. package/esm/mapSchema.js +1 -1
  61. package/esm/parse-graphql-json.js +1 -1
  62. package/esm/parse-graphql-sdl.js +1 -1
  63. package/esm/print-schema-with-directives.js +1 -1
  64. package/esm/prune.js +1 -1
  65. package/esm/renameType.js +1 -1
  66. package/esm/rewire.js +1 -1
  67. package/esm/selectionSets.js +1 -1
  68. package/esm/stub.js +2 -1
  69. package/esm/transformInputValue.js +1 -1
  70. package/esm/updateArgument.js +1 -1
  71. package/esm/validate-documents.js +1 -1
  72. package/esm/visitResult.js +1 -1
  73. package/package.json +2 -4
  74. package/typings/Interfaces.d.cts +1 -1
  75. package/typings/Interfaces.d.ts +1 -1
  76. package/typings/addTypes.d.cts +1 -1
  77. package/typings/addTypes.d.ts +1 -1
  78. package/typings/astFromType.d.cts +1 -1
  79. package/typings/astFromType.d.ts +1 -1
  80. package/typings/astFromValueUntyped.d.cts +1 -1
  81. package/typings/astFromValueUntyped.d.ts +1 -1
  82. package/typings/build-operation-for-field.d.cts +1 -1
  83. package/typings/build-operation-for-field.d.ts +1 -1
  84. package/typings/collectFields.d.cts +1 -1
  85. package/typings/collectFields.d.ts +1 -1
  86. package/typings/comments.d.cts +1 -1
  87. package/typings/comments.d.ts +1 -1
  88. package/typings/errors.d.cts +1 -1
  89. package/typings/errors.d.ts +1 -1
  90. package/typings/fields.d.cts +1 -1
  91. package/typings/fields.d.ts +1 -1
  92. package/typings/filterSchema.d.cts +1 -1
  93. package/typings/filterSchema.d.ts +1 -1
  94. package/typings/fixSchemaAst.d.cts +1 -1
  95. package/typings/fixSchemaAst.d.ts +1 -1
  96. package/typings/forEachDefaultValue.d.cts +1 -1
  97. package/typings/forEachDefaultValue.d.ts +1 -1
  98. package/typings/forEachField.d.cts +1 -1
  99. package/typings/forEachField.d.ts +1 -1
  100. package/typings/get-directives.d.cts +1 -1
  101. package/typings/get-directives.d.ts +1 -1
  102. package/typings/get-fields-with-directives.d.cts +1 -1
  103. package/typings/get-fields-with-directives.d.ts +1 -1
  104. package/typings/get-implementing-types.d.cts +1 -1
  105. package/typings/get-implementing-types.d.ts +1 -1
  106. package/typings/getArgumentValues.d.cts +1 -1
  107. package/typings/getArgumentValues.d.ts +1 -1
  108. package/typings/getObjectTypeFromTypeMap.d.cts +1 -1
  109. package/typings/getObjectTypeFromTypeMap.d.ts +1 -1
  110. package/typings/getOperationASTFromRequest.d.cts +1 -1
  111. package/typings/getOperationASTFromRequest.d.ts +1 -1
  112. package/typings/getResolversFromSchema.d.cts +1 -1
  113. package/typings/getResolversFromSchema.d.ts +1 -1
  114. package/typings/getResponseKeyFromInfo.d.cts +1 -1
  115. package/typings/getResponseKeyFromInfo.d.ts +1 -1
  116. package/typings/heal.d.cts +1 -1
  117. package/typings/heal.d.ts +1 -1
  118. package/typings/helpers.d.cts +2 -2
  119. package/typings/helpers.d.ts +2 -2
  120. package/typings/implementsAbstractType.d.cts +1 -1
  121. package/typings/implementsAbstractType.d.ts +1 -1
  122. package/typings/isDocumentNode.d.cts +1 -1
  123. package/typings/isDocumentNode.d.ts +1 -1
  124. package/typings/loaders.d.cts +1 -1
  125. package/typings/loaders.d.ts +1 -1
  126. package/typings/mapSchema.d.cts +1 -1
  127. package/typings/mapSchema.d.ts +1 -1
  128. package/typings/parse-graphql-json.d.cts +1 -1
  129. package/typings/parse-graphql-json.d.ts +1 -1
  130. package/typings/parse-graphql-sdl.d.cts +1 -1
  131. package/typings/parse-graphql-sdl.d.ts +1 -1
  132. package/typings/print-schema-with-directives.d.cts +1 -1
  133. package/typings/print-schema-with-directives.d.ts +1 -1
  134. package/typings/prune.d.cts +1 -1
  135. package/typings/prune.d.ts +1 -1
  136. package/typings/renameType.d.cts +1 -1
  137. package/typings/renameType.d.ts +1 -1
  138. package/typings/rewire.d.cts +1 -1
  139. package/typings/rewire.d.ts +1 -1
  140. package/typings/rootTypes.d.cts +1 -1
  141. package/typings/rootTypes.d.ts +1 -1
  142. package/typings/selectionSets.d.cts +1 -1
  143. package/typings/selectionSets.d.ts +1 -1
  144. package/typings/stub.d.cts +1 -1
  145. package/typings/stub.d.ts +1 -1
  146. package/typings/transformInputValue.d.cts +1 -1
  147. package/typings/transformInputValue.d.ts +1 -1
  148. package/typings/types.d.cts +1 -1
  149. package/typings/types.d.ts +1 -1
  150. package/typings/updateArgument.d.cts +1 -1
  151. package/typings/updateArgument.d.ts +1 -1
  152. package/typings/validate-documents.d.cts +2 -2
  153. package/typings/validate-documents.d.ts +2 -2
  154. package/typings/visitResult.d.cts +1 -1
  155. package/typings/visitResult.d.ts +1 -1
package/cjs/addTypes.js CHANGED
@@ -28,7 +28,7 @@
28
28
  //
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.addTypes = void 0;
31
- const graphql_1 = require("graphql");
31
+ const graphql_1 = require("@graphql-tools/graphql");
32
32
  const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js");
33
33
  const rewire_js_1 = require("./rewire.js");
34
34
  function addTypes(schema, newTypesOrDirectives) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.astFromType = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const inspect_js_1 = require("./inspect.js");
6
6
  function astFromType(type) {
7
7
  if ((0, graphql_1.isNonNullType)(type)) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.astFromValueUntyped = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  /**
6
6
  * Produces a GraphQL Value AST given a JavaScript object.
7
7
  * Function will match JavaScript/JSON values to GraphQL AST schema format
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildOperationNodeForField = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const rootTypes_js_1 = require("./rootTypes.js");
6
6
  let operationVariables = [];
7
7
  let fieldTypeMap = new Map();
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.collectSubFields = exports.collectFields = void 0;
4
4
  const memoize_js_1 = require("./memoize.js");
5
- const graphql_1 = require("graphql");
5
+ const graphql_1 = require("@graphql-tools/graphql");
6
6
  // Taken from GraphQL-JS v16 for backwards compat
7
7
  function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, fields, visitedFragmentNames) {
8
8
  for (const selection of selectionSet.selections) {
package/cjs/comments.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBlockStringIndentation = exports.dedentBlockStringValue = exports.getLeadingCommentBlock = exports.getComment = exports.getDescription = exports.printWithComments = exports.printComment = exports.pushComment = exports.collectComment = exports.resetComments = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const MAX_LINE_LENGTH = 80;
6
6
  let commentsRegistry = {};
7
7
  function resetComments() {
package/cjs/errors.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.relocatedError = exports.createGraphQLError = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function createGraphQLError(message, options) {
6
6
  if (graphql_1.versionInfo.major >= 17) {
7
7
  return new graphql_1.GraphQLError(message, options);
package/cjs/fields.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.modifyObjectFields = exports.selectObjectFields = exports.removeObjectFields = exports.appendObjectFields = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const Interfaces_js_1 = require("./Interfaces.js");
6
6
  const mapSchema_js_1 = require("./mapSchema.js");
7
7
  const addTypes_js_1 = require("./addTypes.js");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.filterSchema = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const Interfaces_js_1 = require("./Interfaces.js");
6
6
  const mapSchema_js_1 = require("./mapSchema.js");
7
7
  function filterSchema({ schema, typeFilter = () => true, fieldFilter = undefined, rootFieldFilter = undefined, objectFieldFilter = undefined, interfaceFieldFilter = undefined, inputObjectFieldFilter = undefined, argumentFilter = undefined, }) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixSchemaAst = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const print_schema_with_directives_js_1 = require("./print-schema-with-directives.js");
6
6
  function buildFixedSchema(schema, options) {
7
7
  const document = (0, print_schema_with_directives_js_1.getDocumentNodeFromSchema)(schema);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.forEachDefaultValue = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function forEachDefaultValue(schema, fn) {
6
6
  const typeMap = schema.getTypeMap();
7
7
  for (const typeName in typeMap) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.forEachField = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function forEachField(schema, fn) {
6
6
  const typeMap = schema.getTypeMap();
7
7
  for (const typeName in typeMap) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFieldsWithDirectives = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function parseDirectiveValue(value) {
6
6
  switch (value.kind) {
7
7
  case graphql_1.Kind.INT:
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getImplementingTypes = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function getImplementingTypes(interfaceName, schema) {
6
6
  const allTypesMap = schema.getTypeMap();
7
7
  const result = [];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getArgumentValues = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const errors_js_1 = require("./errors.js");
6
6
  const inspect_js_1 = require("./inspect.js");
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getObjectTypeFromTypeMap = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function getObjectTypeFromTypeMap(typeMap, type) {
6
6
  if (type) {
7
7
  const maybeObjectType = typeMap[type.name];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOperationASTFromRequest = exports.getOperationASTFromDocument = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const memoize_js_1 = require("./memoize.js");
6
6
  function getOperationASTFromDocument(documentNode, operationName) {
7
7
  const doc = (0, graphql_1.getOperationAST)(documentNode, operationName);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getResolversFromSchema = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function getResolversFromSchema(schema,
6
6
  // Include default merged resolvers
7
7
  includeDefaultMergedResolver) {
package/cjs/heal.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.healTypes = exports.healSchema = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  // Update any references to named schema types that disagree with the named
6
6
  // types found in schema.getTypeMap().
7
7
  //
@@ -157,6 +157,7 @@ function healTypes(originalTypeMap, directives) {
157
157
  }
158
158
  else if ((0, graphql_1.isNonNullType)(type)) {
159
159
  const healedType = healType(type.ofType);
160
+ // @ts-expect-error TODO: What is going on here?
160
161
  return healedType != null ? new graphql_1.GraphQLNonNull(healedType) : null;
161
162
  }
162
163
  else if ((0, graphql_1.isNamedType)(type)) {
package/cjs/helpers.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assertSome = exports.isSome = exports.compareNodes = exports.nodeToString = exports.compareStrings = exports.isValidPath = exports.isDocumentString = exports.asArray = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []);
6
6
  exports.asArray = asArray;
7
7
  const invalidDocRegex = /\.[a-z0-9]+$/i;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.implementsAbstractType = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function implementsAbstractType(schema, typeA, typeB) {
6
6
  if (typeB == null || typeA == null) {
7
7
  return false;
package/cjs/inspect.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // https://github.com/graphql/graphql-js/blob/main/src/jsutils/inspect.ts
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.inspect = void 0;
6
- const graphql_1 = require("graphql");
6
+ const graphql_1 = require("@graphql-tools/graphql");
7
7
  const AggregateError_js_1 = require("./AggregateError.js");
8
8
  const MAX_RECURSIVE_DEPTH = 3;
9
9
  /**
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isDocumentNode = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function isDocumentNode(object) {
6
6
  return object && typeof object === 'object' && 'kind' in object && object.kind === graphql_1.Kind.DOCUMENT;
7
7
  }
package/cjs/mapSchema.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.correctASTNodes = exports.mapSchema = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js");
6
6
  const Interfaces_js_1 = require("./Interfaces.js");
7
7
  const rewire_js_1 = require("./rewire.js");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseGraphQLJSON = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function stripBOM(content) {
6
6
  content = content.toString();
7
7
  // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isDescribable = exports.transformCommentsToDescriptions = exports.parseGraphQLSDL = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const comments_js_1 = require("./comments.js");
6
6
  function parseGraphQLSDL(location, rawSDL, options = {}) {
7
7
  let document;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeDirectiveNodes = exports.makeDirectiveNode = exports.makeDeprecatedDirective = exports.astFromEnumValue = exports.astFromInputField = exports.astFromField = exports.astFromScalarType = exports.astFromEnumType = exports.astFromInputObjectType = exports.astFromUnionType = exports.astFromInterfaceType = exports.astFromObjectType = exports.astFromArg = exports.getDeprecatableDirectiveNodes = exports.getDirectiveNodes = exports.astFromDirective = exports.astFromSchema = exports.printSchemaWithDirectives = exports.getDocumentNodeFromSchema = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const astFromType_js_1 = require("./astFromType.js");
6
6
  const get_directives_js_1 = require("./get-directives.js");
7
7
  const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js");
package/cjs/prune.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pruneSchema = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const mapSchema_js_1 = require("./mapSchema.js");
6
6
  const Interfaces_js_1 = require("./Interfaces.js");
7
7
  const rootTypes_js_1 = require("./rootTypes.js");
package/cjs/renameType.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renameType = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function renameType(type, newTypeName) {
6
6
  if ((0, graphql_1.isObjectType)(type)) {
7
7
  return new graphql_1.GraphQLObjectType({
package/cjs/rewire.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rewireTypes = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const stub_js_1 = require("./stub.js");
6
6
  function rewireTypes(originalTypeMap, directives) {
7
7
  const referenceTypeMap = Object.create(null);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseSelectionSet = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function parseSelectionSet(selectionSet, options) {
6
6
  const query = (0, graphql_1.parse)(selectionSet, options).definitions[0];
7
7
  return query.selectionSet;
package/cjs/stub.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBuiltInForStub = exports.isNamedStub = exports.createStub = exports.createNamedStub = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function createNamedStub(name, type) {
6
6
  let constructor;
7
7
  if (type === 'object') {
@@ -28,6 +28,7 @@ function createStub(node, type) {
28
28
  case graphql_1.Kind.LIST_TYPE:
29
29
  return new graphql_1.GraphQLList(createStub(node.type, type));
30
30
  case graphql_1.Kind.NON_NULL_TYPE:
31
+ // @ts-expect-error TODO: What is going on here?
31
32
  return new graphql_1.GraphQLNonNull(createStub(node.type, type));
32
33
  default:
33
34
  if (type === 'output') {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseInputValueLiteral = exports.parseInputValue = exports.serializeInputValue = exports.transformInputValue = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  function transformInputValue(type, value, inputLeafValueTransformer = null, inputObjectValueTransformer = null) {
6
6
  if (value == null) {
7
7
  return value;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createVariableNameGenerator = exports.updateArgument = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const astFromType_js_1 = require("./astFromType.js");
6
6
  function updateArgument(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value) {
7
7
  argumentNodes[argName] = {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createDefaultRules = exports.checkValidationErrors = exports.validateGraphQlDocuments = void 0;
4
- const graphql_1 = require("graphql");
4
+ const graphql_1 = require("@graphql-tools/graphql");
5
5
  const AggregateError_js_1 = require("./AggregateError.js");
6
6
  async function validateGraphQlDocuments(schema, documentFiles, effectiveRules = createDefaultRules()) {
7
7
  const allFragmentMap = new Map();
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.visitResult = exports.visitErrors = exports.visitData = void 0;
4
4
  const getOperationASTFromRequest_js_1 = require("./getOperationASTFromRequest.js");
5
- const graphql_1 = require("graphql");
5
+ const graphql_1 = require("@graphql-tools/graphql");
6
6
  const collectFields_js_1 = require("./collectFields.js");
7
7
  function visitData(data, enter, leave) {
8
8
  if (Array.isArray(data)) {
package/esm/addTypes.js CHANGED
@@ -25,7 +25,7 @@
25
25
  //
26
26
  // enhanceSchema can fill this gap by adding an additional round of rewiring.
27
27
  //
28
- import { GraphQLSchema, isNamedType, isDirective } from 'graphql';
28
+ import { GraphQLSchema, isNamedType, isDirective } from '@graphql-tools/graphql';
29
29
  import { getObjectTypeFromTypeMap } from './getObjectTypeFromTypeMap.js';
30
30
  import { rewireTypes } from './rewire.js';
31
31
  export function addTypes(schema, newTypesOrDirectives) {
@@ -1,4 +1,4 @@
1
- import { isNonNullType, Kind, isListType } from 'graphql';
1
+ import { isNonNullType, Kind, isListType } from '@graphql-tools/graphql';
2
2
  import { inspect } from './inspect.js';
3
3
  export function astFromType(type) {
4
4
  if (isNonNullType(type)) {
@@ -1,4 +1,4 @@
1
- import { Kind } from 'graphql';
1
+ import { Kind } from '@graphql-tools/graphql';
2
2
  /**
3
3
  * Produces a GraphQL Value AST given a JavaScript object.
4
4
  * Function will match JavaScript/JSON values to GraphQL AST schema format
@@ -1,4 +1,4 @@
1
- import { isObjectType, getNamedType, isUnionType, isNonNullType, isScalarType, isListType, isInterfaceType, isEnumType, Kind, } from 'graphql';
1
+ import { isObjectType, getNamedType, isUnionType, isNonNullType, isScalarType, isListType, isInterfaceType, isEnumType, Kind, } from '@graphql-tools/graphql';
2
2
  import { getDefinedRootType, getRootTypeNames } from './rootTypes.js';
3
3
  let operationVariables = [];
4
4
  let fieldTypeMap = new Map();
@@ -1,5 +1,5 @@
1
1
  import { memoize5 } from './memoize.js';
2
- import { Kind, getDirectiveValues, GraphQLSkipDirective, GraphQLIncludeDirective, isAbstractType, typeFromAST, } from 'graphql';
2
+ import { Kind, getDirectiveValues, GraphQLSkipDirective, GraphQLIncludeDirective, isAbstractType, typeFromAST, } from '@graphql-tools/graphql';
3
3
  // Taken from GraphQL-JS v16 for backwards compat
4
4
  export function collectFields(schema, fragments, variableValues, runtimeType, selectionSet, fields, visitedFragmentNames) {
5
5
  for (const selection of selectionSet.selections) {
package/esm/comments.js CHANGED
@@ -1,4 +1,4 @@
1
- import { visit, TokenKind, } from 'graphql';
1
+ import { visit, TokenKind, } from '@graphql-tools/graphql';
2
2
  const MAX_LINE_LENGTH = 80;
3
3
  let commentsRegistry = {};
4
4
  export function resetComments() {
package/esm/errors.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GraphQLError, versionInfo } from 'graphql';
1
+ import { GraphQLError, versionInfo } from '@graphql-tools/graphql';
2
2
  export function createGraphQLError(message, options) {
3
3
  if (versionInfo.major >= 17) {
4
4
  return new GraphQLError(message, options);
package/esm/fields.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GraphQLObjectType } from 'graphql';
1
+ import { GraphQLObjectType } from '@graphql-tools/graphql';
2
2
  import { MapperKind } from './Interfaces.js';
3
3
  import { mapSchema, correctASTNodes } from './mapSchema.js';
4
4
  import { addTypes } from './addTypes.js';
@@ -1,4 +1,4 @@
1
- import { GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, } from 'graphql';
1
+ import { GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, } from '@graphql-tools/graphql';
2
2
  import { MapperKind } from './Interfaces.js';
3
3
  import { mapSchema } from './mapSchema.js';
4
4
  export function filterSchema({ schema, typeFilter = () => true, fieldFilter = undefined, rootFieldFilter = undefined, objectFieldFilter = undefined, interfaceFieldFilter = undefined, inputObjectFieldFilter = undefined, argumentFilter = undefined, }) {
@@ -1,4 +1,4 @@
1
- import { buildASTSchema } from 'graphql';
1
+ import { buildASTSchema } from '@graphql-tools/graphql';
2
2
  import { getDocumentNodeFromSchema } from './print-schema-with-directives.js';
3
3
  function buildFixedSchema(schema, options) {
4
4
  const document = getDocumentNodeFromSchema(schema);
@@ -1,4 +1,4 @@
1
- import { getNamedType, isObjectType, isInputObjectType } from 'graphql';
1
+ import { getNamedType, isObjectType, isInputObjectType } from '@graphql-tools/graphql';
2
2
  export function forEachDefaultValue(schema, fn) {
3
3
  const typeMap = schema.getTypeMap();
4
4
  for (const typeName in typeMap) {
@@ -1,4 +1,4 @@
1
- import { getNamedType, isObjectType } from 'graphql';
1
+ import { getNamedType, isObjectType } from '@graphql-tools/graphql';
2
2
  export function forEachField(schema, fn) {
3
3
  const typeMap = schema.getTypeMap();
4
4
  for (const typeName in typeMap) {
@@ -1,4 +1,4 @@
1
- import { Kind, } from 'graphql';
1
+ import { Kind, } from '@graphql-tools/graphql';
2
2
  function parseDirectiveValue(value) {
3
3
  switch (value.kind) {
4
4
  case Kind.INT:
@@ -1,4 +1,4 @@
1
- import { isObjectType } from 'graphql';
1
+ import { isObjectType } from '@graphql-tools/graphql';
2
2
  export function getImplementingTypes(interfaceName, schema) {
3
3
  const allTypesMap = schema.getTypeMap();
4
4
  const result = [];
@@ -1,4 +1,4 @@
1
- import { valueFromAST, isNonNullType, Kind, print, } from 'graphql';
1
+ import { valueFromAST, isNonNullType, Kind, print, } from '@graphql-tools/graphql';
2
2
  import { createGraphQLError } from './errors.js';
3
3
  import { inspect } from './inspect.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { isObjectType } from 'graphql';
1
+ import { isObjectType } from '@graphql-tools/graphql';
2
2
  export function getObjectTypeFromTypeMap(typeMap, type) {
3
3
  if (type) {
4
4
  const maybeObjectType = typeMap[type.name];
@@ -1,4 +1,4 @@
1
- import { getOperationAST } from 'graphql';
1
+ import { getOperationAST } from '@graphql-tools/graphql';
2
2
  import { memoize1 } from './memoize.js';
3
3
  export function getOperationASTFromDocument(documentNode, operationName) {
4
4
  const doc = getOperationAST(documentNode, operationName);
@@ -1,4 +1,4 @@
1
- import { GraphQLScalarType, isScalarType, isEnumType, isInterfaceType, isUnionType, isObjectType, isSpecifiedScalarType, } from 'graphql';
1
+ import { GraphQLScalarType, isScalarType, isEnumType, isInterfaceType, isUnionType, isObjectType, isSpecifiedScalarType, } from '@graphql-tools/graphql';
2
2
  export function getResolversFromSchema(schema,
3
3
  // Include default merged resolvers
4
4
  includeDefaultMergedResolver) {
package/esm/heal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GraphQLList, GraphQLNonNull, isNamedType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isLeafType, isListType, isNonNullType, } from 'graphql';
1
+ import { GraphQLList, GraphQLNonNull, isNamedType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isLeafType, isListType, isNonNullType, } from '@graphql-tools/graphql';
2
2
  // Update any references to named schema types that disagree with the named
3
3
  // types found in schema.getTypeMap().
4
4
  //
@@ -153,6 +153,7 @@ export function healTypes(originalTypeMap, directives) {
153
153
  }
154
154
  else if (isNonNullType(type)) {
155
155
  const healedType = healType(type.ofType);
156
+ // @ts-expect-error TODO: What is going on here?
156
157
  return healedType != null ? new GraphQLNonNull(healedType) : null;
157
158
  }
158
159
  else if (isNamedType(type)) {
package/esm/helpers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { parse } from 'graphql';
1
+ import { parse } from '@graphql-tools/graphql';
2
2
  export const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []);
3
3
  const invalidDocRegex = /\.[a-z0-9]+$/i;
4
4
  export function isDocumentString(str) {
@@ -1,4 +1,4 @@
1
- import { doTypesOverlap, isCompositeType } from 'graphql';
1
+ import { doTypesOverlap, isCompositeType } from '@graphql-tools/graphql';
2
2
  export function implementsAbstractType(schema, typeA, typeB) {
3
3
  if (typeB == null || typeA == null) {
4
4
  return false;
package/esm/inspect.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Taken from graphql-js
2
2
  // https://github.com/graphql/graphql-js/blob/main/src/jsutils/inspect.ts
3
- import { GraphQLError } from 'graphql';
3
+ import { GraphQLError } from '@graphql-tools/graphql';
4
4
  import { isAggregateError } from './AggregateError.js';
5
5
  const MAX_RECURSIVE_DEPTH = 3;
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { Kind } from 'graphql';
1
+ import { Kind } from '@graphql-tools/graphql';
2
2
  export function isDocumentNode(object) {
3
3
  return object && typeof object === 'object' && 'kind' in object && object.kind === Kind.DOCUMENT;
4
4
  }
package/esm/mapSchema.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GraphQLObjectType, GraphQLSchema, isInterfaceType, isEnumType, isObjectType, isScalarType, isUnionType, isInputObjectType, GraphQLInputObjectType, GraphQLInterfaceType, isLeafType, isListType, isNonNullType, isNamedType, GraphQLList, GraphQLNonNull, GraphQLEnumType, Kind, } from 'graphql';
1
+ import { GraphQLObjectType, GraphQLSchema, isInterfaceType, isEnumType, isObjectType, isScalarType, isUnionType, isInputObjectType, GraphQLInputObjectType, GraphQLInterfaceType, isLeafType, isListType, isNonNullType, isNamedType, GraphQLList, GraphQLNonNull, GraphQLEnumType, Kind, } from '@graphql-tools/graphql';
2
2
  import { getObjectTypeFromTypeMap } from './getObjectTypeFromTypeMap.js';
3
3
  import { MapperKind, } from './Interfaces.js';
4
4
  import { rewireTypes } from './rewire.js';
@@ -1,4 +1,4 @@
1
- import { buildClientSchema } from 'graphql';
1
+ import { buildClientSchema } from '@graphql-tools/graphql';
2
2
  function stripBOM(content) {
3
3
  content = content.toString();
4
4
  // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
@@ -1,4 +1,4 @@
1
- import { Kind, parse, Source as GraphQLSource, visit, isTypeSystemDefinitionNode, print, } from 'graphql';
1
+ import { Kind, parse, Source as GraphQLSource, visit, isTypeSystemDefinitionNode, print, } from '@graphql-tools/graphql';
2
2
  import { dedentBlockStringValue, getLeadingCommentBlock } from './comments.js';
3
3
  export function parseGraphQLSDL(location, rawSDL, options = {}) {
4
4
  let document;
@@ -1,4 +1,4 @@
1
- import { print, Kind, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, astFromValue, GraphQLDeprecatedDirective, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isEnumType, isScalarType, } from 'graphql';
1
+ import { print, Kind, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, astFromValue, GraphQLDeprecatedDirective, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isEnumType, isScalarType, } from '@graphql-tools/graphql';
2
2
  import { astFromType } from './astFromType.js';
3
3
  import { getDirectivesInExtensions } from './get-directives.js';
4
4
  import { astFromValueUntyped } from './astFromValueUntyped.js';
package/esm/prune.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getNamedType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isSpecifiedScalarType, isScalarType, } from 'graphql';
1
+ import { getNamedType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isSpecifiedScalarType, isScalarType, } from '@graphql-tools/graphql';
2
2
  import { mapSchema } from './mapSchema.js';
3
3
  import { MapperKind } from './Interfaces.js';
4
4
  import { getRootTypes } from './rootTypes.js';
package/esm/renameType.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInterfaceType, isInputObjectType, isObjectType, isScalarType, isUnionType, } from 'graphql';
1
+ import { GraphQLEnumType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType, GraphQLScalarType, GraphQLUnionType, isEnumType, isInterfaceType, isInputObjectType, isObjectType, isScalarType, isUnionType, } from '@graphql-tools/graphql';
2
2
  export function renameType(type, newTypeName) {
3
3
  if (isObjectType(type)) {
4
4
  return new GraphQLObjectType({