@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/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 AggregateError from '@ardatan/aggregate-error';
3
3
  import { camelCase } from 'camel-case';
4
4
 
@@ -444,6 +444,13 @@ function getDocumentNodeFromSchema(schema, options = {}) {
444
444
  const typesMap = schema.getTypeMap();
445
445
  const schemaNode = astFromSchema(schema, pathToDirectivesInExtensions);
446
446
  const definitions = schemaNode != null ? [schemaNode] : [];
447
+ const directives = schema.getDirectives();
448
+ for (const directive of directives) {
449
+ if (isSpecifiedDirective(directive)) {
450
+ continue;
451
+ }
452
+ definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
453
+ }
447
454
  for (const typeName in typesMap) {
448
455
  const type = typesMap[typeName];
449
456
  const isPredefinedScalar = isSpecifiedScalarType(type);
@@ -473,13 +480,6 @@ function getDocumentNodeFromSchema(schema, options = {}) {
473
480
  throw new Error(`Unknown type ${type}.`);
474
481
  }
475
482
  }
476
- const directives = schema.getDirectives();
477
- for (const directive of directives) {
478
- if (isSpecifiedDirective(directive)) {
479
- continue;
480
- }
481
- definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
482
- }
483
483
  return {
484
484
  kind: Kind.DOCUMENT,
485
485
  definitions,