@graphql-tools/utils 7.7.2 → 7.7.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.
package/es5/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { parse, isNonNullType, GraphQLError, Kind, valueFromAST, print, isObjectType, isListType, isSpecifiedScalarType, isIntrospectionType, astFromValue, isInterfaceType, isUnionType, isInputObjectType, isEnumType, isScalarType, isSpecifiedDirective, GraphQLDeprecatedDirective, specifiedRules, validate, buildSchema, Source, TokenKind, visit, isTypeSystemDefinitionNode, buildClientSchema, getNamedType, GraphQLString, GraphQLNonNull, GraphQLList, GraphQLID, GraphQLBoolean, GraphQLFloat, GraphQLInt, GraphQLObjectType, GraphQLInterfaceType, GraphQLInputObjectType, GraphQLDirective, GraphQLUnionType, GraphQLEnumType, GraphQLScalarType, isNamedType, getNullableType, isLeafType, GraphQLSchema, isSchema, isInputType, valueFromASTUntyped, isDirective, getDirectiveValues, GraphQLSkipDirective, GraphQLIncludeDirective, typeFromAST, isAbstractType, isCompositeType, doTypesOverlap, getOperationAST, getOperationRootType } from 'graphql';
1
+ import { parse, isNonNullType, GraphQLError, Kind, valueFromAST, print, isObjectType, isListType, isSpecifiedDirective, astFromValue, isSpecifiedScalarType, isIntrospectionType, isInterfaceType, isUnionType, isInputObjectType, isEnumType, isScalarType, GraphQLDeprecatedDirective, specifiedRules, validate, buildSchema, Source, TokenKind, visit, isTypeSystemDefinitionNode, buildClientSchema, getNamedType, GraphQLString, GraphQLNonNull, GraphQLList, GraphQLID, GraphQLBoolean, GraphQLFloat, GraphQLInt, GraphQLObjectType, GraphQLInterfaceType, GraphQLInputObjectType, GraphQLDirective, GraphQLUnionType, GraphQLEnumType, GraphQLScalarType, isNamedType, getNullableType, isLeafType, GraphQLSchema, isSchema, isInputType, valueFromASTUntyped, isDirective, getDirectiveValues, GraphQLSkipDirective, GraphQLIncludeDirective, typeFromAST, isAbstractType, isCompositeType, doTypesOverlap, getOperationAST, getOperationRootType } from 'graphql';
2
2
  import { __spreadArray, __read, __assign, __values, __awaiter, __generator, __extends } from 'tslib';
3
3
  import AggregateError from '@ardatan/aggregate-error';
4
4
  import { camelCase } from 'camel-case';
@@ -497,6 +497,23 @@ function getDocumentNodeFromSchema(schema, options) {
497
497
  var typesMap = schema.getTypeMap();
498
498
  var schemaNode = astFromSchema(schema, pathToDirectivesInExtensions);
499
499
  var definitions = schemaNode != null ? [schemaNode] : [];
500
+ var directives = schema.getDirectives();
501
+ try {
502
+ for (var directives_1 = __values(directives), directives_1_1 = directives_1.next(); !directives_1_1.done; directives_1_1 = directives_1.next()) {
503
+ var directive = directives_1_1.value;
504
+ if (isSpecifiedDirective(directive)) {
505
+ continue;
506
+ }
507
+ definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
508
+ }
509
+ }
510
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
511
+ finally {
512
+ try {
513
+ if (directives_1_1 && !directives_1_1.done && (_a = directives_1.return)) _a.call(directives_1);
514
+ }
515
+ finally { if (e_1) throw e_1.error; }
516
+ }
500
517
  for (var typeName in typesMap) {
501
518
  var type = typesMap[typeName];
502
519
  var isPredefinedScalar = isSpecifiedScalarType(type);
@@ -526,23 +543,6 @@ function getDocumentNodeFromSchema(schema, options) {
526
543
  throw new Error("Unknown type " + type + ".");
527
544
  }
528
545
  }
529
- var directives = schema.getDirectives();
530
- try {
531
- for (var directives_1 = __values(directives), directives_1_1 = directives_1.next(); !directives_1_1.done; directives_1_1 = directives_1.next()) {
532
- var directive = directives_1_1.value;
533
- if (isSpecifiedDirective(directive)) {
534
- continue;
535
- }
536
- definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
537
- }
538
- }
539
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
540
- finally {
541
- try {
542
- if (directives_1_1 && !directives_1_1.done && (_a = directives_1.return)) _a.call(directives_1);
543
- }
544
- finally { if (e_1) throw e_1.error; }
545
- }
546
546
  return {
547
547
  kind: Kind.DOCUMENT,
548
548
  definitions: definitions,