@graphql-codegen/schema-ast 2.5.1-alpha-0814e49cc.0 → 2.5.1
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 +3 -3
- package/typings/index.d.cts +71 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/schema-ast",
|
|
3
|
-
"version": "2.5.1
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating a .graphql file from a given schema",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "^2.6.
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
10
10
|
"@graphql-tools/utils": "^8.8.0",
|
|
11
11
|
"tslib": "~2.4.0"
|
|
12
12
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"require": {
|
|
29
|
-
"types": "./typings/index.d.
|
|
29
|
+
"types": "./typings/index.d.cts",
|
|
30
30
|
"default": "./cjs/index.js"
|
|
31
31
|
},
|
|
32
32
|
"import": {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
3
|
+
/**
|
|
4
|
+
* @description This plugin prints the merged schema as string. If multiple schemas are provided, they will be merged and printed as one schema.
|
|
5
|
+
*/
|
|
6
|
+
export interface SchemaASTConfig {
|
|
7
|
+
/**
|
|
8
|
+
* @description Include directives to Schema output.
|
|
9
|
+
* @default false
|
|
10
|
+
*
|
|
11
|
+
* @exampleMarkdown
|
|
12
|
+
* ```yaml {8}
|
|
13
|
+
* schema:
|
|
14
|
+
* - './src/schema.graphql'
|
|
15
|
+
* generates:
|
|
16
|
+
* path/to/file.graphql:
|
|
17
|
+
* plugins:
|
|
18
|
+
* - schema-ast
|
|
19
|
+
* config:
|
|
20
|
+
* includeDirectives: true
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
includeDirectives?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @description Include introspection types to Schema output.
|
|
26
|
+
* @default false
|
|
27
|
+
*
|
|
28
|
+
* @exampleMarkdown
|
|
29
|
+
* ```yaml {8}
|
|
30
|
+
* schema:
|
|
31
|
+
* - './src/schema.graphql'
|
|
32
|
+
* generates:
|
|
33
|
+
* path/to/file.graphql:
|
|
34
|
+
* plugins:
|
|
35
|
+
* - schema-ast
|
|
36
|
+
* config:
|
|
37
|
+
* includeIntrospectionTypes: true
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
includeIntrospectionTypes?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @description Set to true in order to print description as comments (using `#` instead of `"""`)
|
|
43
|
+
* @default false
|
|
44
|
+
*
|
|
45
|
+
* @exampleMarkdown
|
|
46
|
+
* ```yaml {7}
|
|
47
|
+
* schema: http://localhost:3000/graphql
|
|
48
|
+
* generates:
|
|
49
|
+
* schema.graphql:
|
|
50
|
+
* plugins:
|
|
51
|
+
* - schema-ast
|
|
52
|
+
* config:
|
|
53
|
+
* commentDescriptions: true
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
commentDescriptions?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* @description Set to false to disable sorting
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
sort?: boolean;
|
|
62
|
+
federation?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export declare const plugin: PluginFunction<SchemaASTConfig>;
|
|
65
|
+
export declare const validate: PluginValidateFn<any>;
|
|
66
|
+
export declare function transformSchemaAST(schema: GraphQLSchema, config: {
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
}): {
|
|
69
|
+
schema: GraphQLSchema;
|
|
70
|
+
ast: import("graphql").DocumentNode;
|
|
71
|
+
};
|