@graphql-tools/utils 7.3.0 → 7.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/utils",
3
- "version": "7.3.0",
3
+ "version": "7.5.0",
4
4
  "description": "Common package containing utils and types for GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -1,5 +1,6 @@
1
- import { GraphQLSchema, GraphQLNamedType, DirectiveNode, InputValueDefinitionNode, GraphQLArgument, GraphQLDirective, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, GraphQLObjectType, ObjectTypeDefinitionNode, GraphQLField, GraphQLInterfaceType, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, GraphQLUnionType, GraphQLInputObjectType, InputObjectTypeDefinitionNode, GraphQLInputField, GraphQLEnumType, GraphQLEnumValue, EnumTypeDefinitionNode } from 'graphql';
2
- import { PrintSchemaWithDirectivesOptions } from './types';
1
+ import { GraphQLSchema, GraphQLNamedType, DirectiveNode, FieldDefinitionNode, InputValueDefinitionNode, GraphQLArgument, EnumValueDefinitionNode, GraphQLDirective, DirectiveDefinitionNode, SchemaDefinitionNode, SchemaExtensionNode, GraphQLObjectType, ObjectTypeDefinitionNode, GraphQLField, GraphQLInterfaceType, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, GraphQLUnionType, GraphQLInputObjectType, InputObjectTypeDefinitionNode, GraphQLInputField, GraphQLEnumType, GraphQLEnumValue, EnumTypeDefinitionNode, GraphQLScalarType, ScalarTypeDefinitionNode, DocumentNode } from 'graphql';
2
+ import { GetDocumentNodeFromSchemaOptions, PrintSchemaWithDirectivesOptions } from './types';
3
+ export declare function getDocumentNodeFromSchema(schema: GraphQLSchema, options?: GetDocumentNodeFromSchemaOptions): DocumentNode;
3
4
  export declare function printSchemaWithDirectives(schema: GraphQLSchema, options?: PrintSchemaWithDirectivesOptions): string;
4
5
  export declare function astFromSchema(schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): SchemaDefinitionNode | SchemaExtensionNode;
5
6
  export declare function astFromDirective(directive: GraphQLDirective, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): DirectiveDefinitionNode;
@@ -11,6 +12,10 @@ export declare function astFromInterfaceType(type: GraphQLInterfaceType, schema:
11
12
  export declare function astFromUnionType(type: GraphQLUnionType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): UnionTypeDefinitionNode;
12
13
  export declare function astFromInputObjectType(type: GraphQLInputObjectType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): InputObjectTypeDefinitionNode;
13
14
  export declare function astFromEnumType(type: GraphQLEnumType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): EnumTypeDefinitionNode;
15
+ export declare function astFromScalarType(type: GraphQLScalarType, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): ScalarTypeDefinitionNode;
16
+ export declare function astFromField(field: GraphQLField<any, any>, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): FieldDefinitionNode;
17
+ export declare function astFromInputField(field: GraphQLInputField, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): InputValueDefinitionNode;
18
+ export declare function astFromEnumValue(value: GraphQLEnumValue, schema: GraphQLSchema, pathToDirectivesInExtensions: Array<string>): EnumValueDefinitionNode;
14
19
  export declare function makeDeprecatedDirective(deprecationReason: string): DirectiveNode;
15
- export declare function makeDirective(name: string, args: Record<string, any>, directive: GraphQLDirective): DirectiveNode;
16
- export declare function makeDirectives(schema: GraphQLSchema, directiveValues: Record<string, any>): Array<DirectiveNode>;
20
+ export declare function makeDirectiveNode(name: string, args: Record<string, any>, directive?: GraphQLDirective): DirectiveNode;
21
+ export declare function makeDirectiveNodes(schema: GraphQLSchema, directiveValues: Record<string, any>): Array<DirectiveNode>;
package/types.d.ts CHANGED
@@ -10,9 +10,10 @@ export interface SchemaPrintOptions {
10
10
  */
11
11
  commentDescriptions?: boolean;
12
12
  }
13
- export interface PrintSchemaWithDirectivesOptions extends SchemaPrintOptions {
13
+ export interface GetDocumentNodeFromSchemaOptions {
14
14
  pathToDirectivesInExtensions?: Array<string>;
15
15
  }
16
+ export declare type PrintSchemaWithDirectivesOptions = SchemaPrintOptions & GetDocumentNodeFromSchemaOptions;
16
17
  export declare type Maybe<T> = null | undefined | T;
17
18
  export declare type Constructor<T> = new (...args: any[]) => T;
18
19
  /**