@graphql-codegen/urql-introspection 2.2.1-alpha-0814e49cc.0 → 2.2.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 +97 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/urql-introspection",
|
|
3
|
-
"version": "2.2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "graphql-code-generate plugin for generating fragments matcher introspection file",
|
|
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
|
"@urql/introspection": "^0.3.2",
|
|
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,97 @@
|
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
2
|
+
/**
|
|
3
|
+
* @description This plugin generates an introspection file for Schema Awareness feature of Urql Cache Exchange
|
|
4
|
+
*
|
|
5
|
+
* You can read more about it in `urql` documentation: https://formidable.com/open-source/urql/docs/graphcache/schema-awareness.
|
|
6
|
+
*
|
|
7
|
+
* Urql Introspection plugin accepts a TypeScript / JavaScript or a JSON file as an output _(`.ts, .tsx, .js, .jsx, .json`)_.
|
|
8
|
+
*
|
|
9
|
+
* Both in TypeScript and JavaScript a default export is being used.
|
|
10
|
+
*
|
|
11
|
+
* > The output is based on the output you choose for the output file name.
|
|
12
|
+
*/
|
|
13
|
+
export interface UrqlIntrospectionConfig {
|
|
14
|
+
/**
|
|
15
|
+
* @description Compatible only with JSON extension, allow you to choose the export type, either `module.exports` or `export default`. Allowed values are: `commonjs`, `es2015`.
|
|
16
|
+
* @default es2015
|
|
17
|
+
*
|
|
18
|
+
* @exampleMarkdown
|
|
19
|
+
* ```yaml {6}
|
|
20
|
+
* generates:
|
|
21
|
+
* path/to/file.json:
|
|
22
|
+
* plugins:
|
|
23
|
+
* - urql-introspection
|
|
24
|
+
* config:
|
|
25
|
+
* module: commonjs
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
module?: 'commonjs' | 'es2015';
|
|
29
|
+
/**
|
|
30
|
+
* @name useTypeImports
|
|
31
|
+
* @type boolean
|
|
32
|
+
* @default false
|
|
33
|
+
* @description Will use `import type {}` rather than `import {}` when importing only types. This gives
|
|
34
|
+
* compatibility with TypeScript's "importsNotUsedAsValues": "error" option
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```yaml
|
|
38
|
+
* config:
|
|
39
|
+
* useTypeImports: true
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
useTypeImports?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* @name includeScalars
|
|
45
|
+
* @type boolean
|
|
46
|
+
* @default false
|
|
47
|
+
* @description Includes scalar names (instead of an `Any` replacement) in the output when enabled.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```yaml
|
|
51
|
+
* config:
|
|
52
|
+
* includeScalars: true
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
includeScalars?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @name includeEnums
|
|
58
|
+
* @type boolean
|
|
59
|
+
* @default false
|
|
60
|
+
* @description Includes enums (instead of an `Any` replacement) in the output when enabled.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```yaml
|
|
64
|
+
* config:
|
|
65
|
+
* includeEnums: true
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
includeEnums?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @name includeInputs
|
|
71
|
+
* @type boolean
|
|
72
|
+
* @default false
|
|
73
|
+
* @description Includes all input objects (instead of an `Any` replacement) in the output when enabled.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```yaml
|
|
77
|
+
* config:
|
|
78
|
+
* includeInputs: true
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
includeInputs?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @name includeDirectives
|
|
84
|
+
* @type boolean
|
|
85
|
+
* @default false
|
|
86
|
+
* @description Includes all directives in the output when enabled.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```yaml
|
|
90
|
+
* config:
|
|
91
|
+
* includeDirectives: true
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
includeDirectives?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export declare const plugin: PluginFunction;
|
|
97
|
+
export declare const validate: PluginValidateFn<any>;
|