@graphql-tools/wrap 8.4.3 → 8.4.4

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 (3) hide show
  1. package/index.js +2 -12
  2. package/index.mjs +3 -13
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1745,21 +1745,11 @@ class ExtractField {
1745
1745
  }
1746
1746
 
1747
1747
  function getSchemaFromIntrospection(introspectionResult, options) {
1748
- var _a, _b;
1748
+ var _a;
1749
1749
  if ((_a = introspectionResult === null || introspectionResult === void 0 ? void 0 : introspectionResult.data) === null || _a === void 0 ? void 0 : _a.__schema) {
1750
1750
  return graphql.buildClientSchema(introspectionResult.data, options);
1751
1751
  }
1752
- else if ((_b = introspectionResult === null || introspectionResult === void 0 ? void 0 : introspectionResult.errors) === null || _b === void 0 ? void 0 : _b.length) {
1753
- if (introspectionResult.errors.length > 1) {
1754
- const combinedError = new utils.AggregateError(introspectionResult.errors, 'Could not obtain introspection result');
1755
- throw combinedError;
1756
- }
1757
- const error = introspectionResult.errors[0];
1758
- throw error.originalError || error;
1759
- }
1760
- else {
1761
- throw new Error('Could not obtain introspection result, received: ' + JSON.stringify(introspectionResult));
1762
- }
1752
+ throw new Error('Could not obtain introspection result, received: ' + JSON.stringify(introspectionResult));
1763
1753
  }
1764
1754
  function introspectSchema(executor, context, options) {
1765
1755
  const parsedIntrospectionQuery = graphql.parse(graphql.getIntrospectionQuery(options), options);
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, isSpecifiedScalarType, isScalarType, visit, Kind, TypeInfo, visitWithTypeInfo, isObjectType, isInterfaceType, typeFromAST, isInputType, isLeafType, valueFromAST, getNullableType, BREAK, parse, getIntrospectionQuery, buildClientSchema } from 'graphql';
2
- import { getRootTypeMap, getResponseKeyFromInfo, mapSchema, MapperKind, renameType, visitData, transformInputValue, visitResult, createVariableNameGenerator, updateArgument, relocatedError, getArgumentValues, valueMatchesCriteria, getDirectives, pruneSchema, selectObjectFields, appendObjectFields, modifyObjectFields, removeObjectFields, isAsyncIterable, AggregateError } from '@graphql-tools/utils';
2
+ import { getRootTypeMap, getResponseKeyFromInfo, mapSchema, MapperKind, renameType, visitData, transformInputValue, visitResult, createVariableNameGenerator, updateArgument, relocatedError, getArgumentValues, valueMatchesCriteria, getDirectives, pruneSchema, selectObjectFields, appendObjectFields, modifyObjectFields, removeObjectFields, isAsyncIterable } from '@graphql-tools/utils';
3
3
  import { applySchemaTransforms, delegateToSchema, isExternalObject, getUnpathedErrors, getSubschema, resolveExternalValue, defaultMergedResolver } from '@graphql-tools/delegate';
4
4
  import { ValueOrPromise } from 'value-or-promise';
5
5
 
@@ -1741,21 +1741,11 @@ class ExtractField {
1741
1741
  }
1742
1742
 
1743
1743
  function getSchemaFromIntrospection(introspectionResult, options) {
1744
- var _a, _b;
1744
+ var _a;
1745
1745
  if ((_a = introspectionResult === null || introspectionResult === void 0 ? void 0 : introspectionResult.data) === null || _a === void 0 ? void 0 : _a.__schema) {
1746
1746
  return buildClientSchema(introspectionResult.data, options);
1747
1747
  }
1748
- else if ((_b = introspectionResult === null || introspectionResult === void 0 ? void 0 : introspectionResult.errors) === null || _b === void 0 ? void 0 : _b.length) {
1749
- if (introspectionResult.errors.length > 1) {
1750
- const combinedError = new AggregateError(introspectionResult.errors, 'Could not obtain introspection result');
1751
- throw combinedError;
1752
- }
1753
- const error = introspectionResult.errors[0];
1754
- throw error.originalError || error;
1755
- }
1756
- else {
1757
- throw new Error('Could not obtain introspection result, received: ' + JSON.stringify(introspectionResult));
1758
- }
1748
+ throw new Error('Could not obtain introspection result, received: ' + JSON.stringify(introspectionResult));
1759
1749
  }
1760
1750
  function introspectSchema(executor, context, options) {
1761
1751
  const parsedIntrospectionQuery = parse(getIntrospectionQuery(options), options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/wrap",
3
- "version": "8.4.3",
3
+ "version": "8.4.4",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {