@graphql-codegen/urql-introspection 2.2.1 → 3.0.0-alpha-20230524082546-d7e1d0a4a

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/cjs/index.js CHANGED
@@ -41,7 +41,9 @@ const validate = async (_schema, _documents, config, outputFile) => {
41
41
  const ext = (0, path_1.extname)(outputFile).toLowerCase();
42
42
  const all = Object.values(extensions).reduce((acc, exts) => [...acc, ...exts], []);
43
43
  if (!all.includes(ext)) {
44
- throw new Error(`Plugin "urql-introspection" requires extension to be one of ${all.map(val => val.replace('.', '')).join(', ')}!`);
44
+ throw new Error(`Plugin "urql-introspection" requires extension to be one of ${all
45
+ .map(val => val.replace('.', ''))
46
+ .join(', ')}!`);
45
47
  }
46
48
  if (config.module === 'commonjs' && extensions.ts.includes(ext)) {
47
49
  throw new Error(`Plugin "urql-introspection" doesn't support commonjs modules combined with TypeScript!`);
package/esm/index.js CHANGED
@@ -37,7 +37,9 @@ export const validate = async (_schema, _documents, config, outputFile) => {
37
37
  const ext = extname(outputFile).toLowerCase();
38
38
  const all = Object.values(extensions).reduce((acc, exts) => [...acc, ...exts], []);
39
39
  if (!all.includes(ext)) {
40
- throw new Error(`Plugin "urql-introspection" requires extension to be one of ${all.map(val => val.replace('.', '')).join(', ')}!`);
40
+ throw new Error(`Plugin "urql-introspection" requires extension to be one of ${all
41
+ .map(val => val.replace('.', ''))
42
+ .join(', ')}!`);
41
43
  }
42
44
  if (config.module === 'commonjs' && extensions.ts.includes(ext)) {
43
45
  throw new Error(`Plugin "urql-introspection" doesn't support commonjs modules combined with TypeScript!`);
package/package.json CHANGED
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "name": "@graphql-codegen/urql-introspection",
3
- "version": "2.2.1",
3
+ "version": "3.0.0-alpha-20230524082546-d7e1d0a4a",
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.2",
9
+ "@graphql-codegen/plugin-helpers": "^3.0.0",
10
10
  "@urql/introspection": "^0.3.2",
11
11
  "tslib": "~2.4.0"
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "https://github.com/dotansimha/graphql-code-generator.git",
15
+ "url": "https://github.com/dotansimha/graphql-code-generator-community.git",
16
16
  "directory": "packages/plugins/other/urql-introspection"
17
17
  },
18
18
  "license": "MIT",
19
+ "engines": {
20
+ "node": ">= 16.0.0"
21
+ },
19
22
  "main": "cjs/index.js",
20
23
  "module": "esm/index.js",
21
24
  "typings": "typings/index.d.ts",
@@ -16,13 +16,22 @@ export interface UrqlIntrospectionConfig {
16
16
  * @default es2015
17
17
  *
18
18
  * @exampleMarkdown
19
- * ```yaml {6}
20
- * generates:
21
- * path/to/file.json:
22
- * plugins:
23
- * - urql-introspection
24
- * config:
25
- * module: commonjs
19
+ * ```tsx {10} filename="codegen.ts"
20
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
21
+ *
22
+ * const config: CodegenConfig = {
23
+ * schema: 'https://localhost:4000/graphql',
24
+ * documents: ['src/**\/*.tsx'],
25
+ * generates: {
26
+ * 'path/to/file.json': {
27
+ * plugins: ['urql-introspection'],
28
+ * config: {
29
+ * module: 'commonjs'
30
+ * },
31
+ * },
32
+ * },
33
+ * };
34
+ * export default config;
26
35
  * ```
27
36
  */
28
37
  module?: 'commonjs' | 'es2015';
@@ -33,10 +42,23 @@ export interface UrqlIntrospectionConfig {
33
42
  * @description Will use `import type {}` rather than `import {}` when importing only types. This gives
34
43
  * compatibility with TypeScript's "importsNotUsedAsValues": "error" option
35
44
  *
36
- * @example
37
- * ```yaml
38
- * config:
39
- * useTypeImports: true
45
+ * @exampleMarkdown
46
+ * ```tsx {10} filename="codegen.ts"
47
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
48
+ *
49
+ * const config: CodegenConfig = {
50
+ * schema: 'https://localhost:4000/graphql',
51
+ * documents: ['src/**\/*.tsx'],
52
+ * generates: {
53
+ * 'path/to/file.json': {
54
+ * plugins: ['urql-introspection'],
55
+ * config: {
56
+ * useTypeImports: true
57
+ * },
58
+ * },
59
+ * },
60
+ * };
61
+ * export default config;
40
62
  * ```
41
63
  */
42
64
  useTypeImports?: boolean;
@@ -46,10 +68,23 @@ export interface UrqlIntrospectionConfig {
46
68
  * @default false
47
69
  * @description Includes scalar names (instead of an `Any` replacement) in the output when enabled.
48
70
  *
49
- * @example
50
- * ```yaml
51
- * config:
52
- * includeScalars: true
71
+ * @exampleMarkdown
72
+ * ```tsx {10} filename="codegen.ts"
73
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
74
+ *
75
+ * const config: CodegenConfig = {
76
+ * schema: 'https://localhost:4000/graphql',
77
+ * documents: ['src/**\/*.tsx'],
78
+ * generates: {
79
+ * 'path/to/file.json': {
80
+ * plugins: ['urql-introspection'],
81
+ * config: {
82
+ * includeScalars: true
83
+ * },
84
+ * },
85
+ * },
86
+ * };
87
+ * export default config;
53
88
  * ```
54
89
  */
55
90
  includeScalars?: boolean;
@@ -59,10 +94,23 @@ export interface UrqlIntrospectionConfig {
59
94
  * @default false
60
95
  * @description Includes enums (instead of an `Any` replacement) in the output when enabled.
61
96
  *
62
- * @example
63
- * ```yaml
64
- * config:
65
- * includeEnums: true
97
+ * @exampleMarkdown
98
+ * ```tsx {10} filename="codegen.ts"
99
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
100
+ *
101
+ * const config: CodegenConfig = {
102
+ * schema: 'https://localhost:4000/graphql',
103
+ * documents: ['src/**\/*.tsx'],
104
+ * generates: {
105
+ * 'path/to/file.json': {
106
+ * plugins: ['urql-introspection'],
107
+ * config: {
108
+ * includeEnums: true
109
+ * },
110
+ * },
111
+ * },
112
+ * };
113
+ * export default config;
66
114
  * ```
67
115
  */
68
116
  includeEnums?: boolean;
@@ -72,10 +120,23 @@ export interface UrqlIntrospectionConfig {
72
120
  * @default false
73
121
  * @description Includes all input objects (instead of an `Any` replacement) in the output when enabled.
74
122
  *
75
- * @example
76
- * ```yaml
77
- * config:
78
- * includeInputs: true
123
+ * @exampleMarkdown
124
+ * ```tsx {10} filename="codegen.ts"
125
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
126
+ *
127
+ * const config: CodegenConfig = {
128
+ * schema: 'https://localhost:4000/graphql',
129
+ * documents: ['src/**\/*.tsx'],
130
+ * generates: {
131
+ * 'path/to/file.json': {
132
+ * plugins: ['urql-introspection'],
133
+ * config: {
134
+ * includeInputs: true
135
+ * },
136
+ * },
137
+ * },
138
+ * };
139
+ * export default config;
79
140
  * ```
80
141
  */
81
142
  includeInputs?: boolean;
@@ -85,10 +146,23 @@ export interface UrqlIntrospectionConfig {
85
146
  * @default false
86
147
  * @description Includes all directives in the output when enabled.
87
148
  *
88
- * @example
89
- * ```yaml
90
- * config:
91
- * includeDirectives: true
149
+ * @exampleMarkdown
150
+ * ```tsx {10} filename="codegen.ts"
151
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
152
+ *
153
+ * const config: CodegenConfig = {
154
+ * schema: 'https://localhost:4000/graphql',
155
+ * documents: ['src/**\/*.tsx'],
156
+ * generates: {
157
+ * 'path/to/file.json': {
158
+ * plugins: ['urql-introspection'],
159
+ * config: {
160
+ * includeDirectives: true
161
+ * },
162
+ * },
163
+ * },
164
+ * };
165
+ * export default config;
92
166
  * ```
93
167
  */
94
168
  includeDirectives?: boolean;
@@ -16,13 +16,22 @@ export interface UrqlIntrospectionConfig {
16
16
  * @default es2015
17
17
  *
18
18
  * @exampleMarkdown
19
- * ```yaml {6}
20
- * generates:
21
- * path/to/file.json:
22
- * plugins:
23
- * - urql-introspection
24
- * config:
25
- * module: commonjs
19
+ * ```tsx {10} filename="codegen.ts"
20
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
21
+ *
22
+ * const config: CodegenConfig = {
23
+ * schema: 'https://localhost:4000/graphql',
24
+ * documents: ['src/**\/*.tsx'],
25
+ * generates: {
26
+ * 'path/to/file.json': {
27
+ * plugins: ['urql-introspection'],
28
+ * config: {
29
+ * module: 'commonjs'
30
+ * },
31
+ * },
32
+ * },
33
+ * };
34
+ * export default config;
26
35
  * ```
27
36
  */
28
37
  module?: 'commonjs' | 'es2015';
@@ -33,10 +42,23 @@ export interface UrqlIntrospectionConfig {
33
42
  * @description Will use `import type {}` rather than `import {}` when importing only types. This gives
34
43
  * compatibility with TypeScript's "importsNotUsedAsValues": "error" option
35
44
  *
36
- * @example
37
- * ```yaml
38
- * config:
39
- * useTypeImports: true
45
+ * @exampleMarkdown
46
+ * ```tsx {10} filename="codegen.ts"
47
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
48
+ *
49
+ * const config: CodegenConfig = {
50
+ * schema: 'https://localhost:4000/graphql',
51
+ * documents: ['src/**\/*.tsx'],
52
+ * generates: {
53
+ * 'path/to/file.json': {
54
+ * plugins: ['urql-introspection'],
55
+ * config: {
56
+ * useTypeImports: true
57
+ * },
58
+ * },
59
+ * },
60
+ * };
61
+ * export default config;
40
62
  * ```
41
63
  */
42
64
  useTypeImports?: boolean;
@@ -46,10 +68,23 @@ export interface UrqlIntrospectionConfig {
46
68
  * @default false
47
69
  * @description Includes scalar names (instead of an `Any` replacement) in the output when enabled.
48
70
  *
49
- * @example
50
- * ```yaml
51
- * config:
52
- * includeScalars: true
71
+ * @exampleMarkdown
72
+ * ```tsx {10} filename="codegen.ts"
73
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
74
+ *
75
+ * const config: CodegenConfig = {
76
+ * schema: 'https://localhost:4000/graphql',
77
+ * documents: ['src/**\/*.tsx'],
78
+ * generates: {
79
+ * 'path/to/file.json': {
80
+ * plugins: ['urql-introspection'],
81
+ * config: {
82
+ * includeScalars: true
83
+ * },
84
+ * },
85
+ * },
86
+ * };
87
+ * export default config;
53
88
  * ```
54
89
  */
55
90
  includeScalars?: boolean;
@@ -59,10 +94,23 @@ export interface UrqlIntrospectionConfig {
59
94
  * @default false
60
95
  * @description Includes enums (instead of an `Any` replacement) in the output when enabled.
61
96
  *
62
- * @example
63
- * ```yaml
64
- * config:
65
- * includeEnums: true
97
+ * @exampleMarkdown
98
+ * ```tsx {10} filename="codegen.ts"
99
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
100
+ *
101
+ * const config: CodegenConfig = {
102
+ * schema: 'https://localhost:4000/graphql',
103
+ * documents: ['src/**\/*.tsx'],
104
+ * generates: {
105
+ * 'path/to/file.json': {
106
+ * plugins: ['urql-introspection'],
107
+ * config: {
108
+ * includeEnums: true
109
+ * },
110
+ * },
111
+ * },
112
+ * };
113
+ * export default config;
66
114
  * ```
67
115
  */
68
116
  includeEnums?: boolean;
@@ -72,10 +120,23 @@ export interface UrqlIntrospectionConfig {
72
120
  * @default false
73
121
  * @description Includes all input objects (instead of an `Any` replacement) in the output when enabled.
74
122
  *
75
- * @example
76
- * ```yaml
77
- * config:
78
- * includeInputs: true
123
+ * @exampleMarkdown
124
+ * ```tsx {10} filename="codegen.ts"
125
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
126
+ *
127
+ * const config: CodegenConfig = {
128
+ * schema: 'https://localhost:4000/graphql',
129
+ * documents: ['src/**\/*.tsx'],
130
+ * generates: {
131
+ * 'path/to/file.json': {
132
+ * plugins: ['urql-introspection'],
133
+ * config: {
134
+ * includeInputs: true
135
+ * },
136
+ * },
137
+ * },
138
+ * };
139
+ * export default config;
79
140
  * ```
80
141
  */
81
142
  includeInputs?: boolean;
@@ -85,10 +146,23 @@ export interface UrqlIntrospectionConfig {
85
146
  * @default false
86
147
  * @description Includes all directives in the output when enabled.
87
148
  *
88
- * @example
89
- * ```yaml
90
- * config:
91
- * includeDirectives: true
149
+ * @exampleMarkdown
150
+ * ```tsx {10} filename="codegen.ts"
151
+ * import type { CodegenConfig } from '@graphql-codegen/cli';
152
+ *
153
+ * const config: CodegenConfig = {
154
+ * schema: 'https://localhost:4000/graphql',
155
+ * documents: ['src/**\/*.tsx'],
156
+ * generates: {
157
+ * 'path/to/file.json': {
158
+ * plugins: ['urql-introspection'],
159
+ * config: {
160
+ * includeDirectives: true
161
+ * },
162
+ * },
163
+ * },
164
+ * };
165
+ * export default config;
92
166
  * ```
93
167
  */
94
168
  includeDirectives?: boolean;