@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/utils/es5",
3
- "version": "7.7.2",
3
+ "version": "7.7.3",
4
4
  "description": "Common package containing utils and types for GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
package/index.cjs.js CHANGED
@@ -450,6 +450,13 @@ function getDocumentNodeFromSchema(schema, options = {}) {
450
450
  const typesMap = schema.getTypeMap();
451
451
  const schemaNode = astFromSchema(schema, pathToDirectivesInExtensions);
452
452
  const definitions = schemaNode != null ? [schemaNode] : [];
453
+ const directives = schema.getDirectives();
454
+ for (const directive of directives) {
455
+ if (graphql.isSpecifiedDirective(directive)) {
456
+ continue;
457
+ }
458
+ definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
459
+ }
453
460
  for (const typeName in typesMap) {
454
461
  const type = typesMap[typeName];
455
462
  const isPredefinedScalar = graphql.isSpecifiedScalarType(type);
@@ -479,13 +486,6 @@ function getDocumentNodeFromSchema(schema, options = {}) {
479
486
  throw new Error(`Unknown type ${type}.`);
480
487
  }
481
488
  }
482
- const directives = schema.getDirectives();
483
- for (const directive of directives) {
484
- if (graphql.isSpecifiedDirective(directive)) {
485
- continue;
486
- }
487
- definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
488
- }
489
489
  return {
490
490
  kind: graphql.Kind.DOCUMENT,
491
491
  definitions,