You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/presets/near-operation-file/src/index.ts
+38-3Lines changed: 38 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ export type NearOperationFileConfig = {
177
177
folder?: string;
178
178
/**
179
179
* @description Optional, override the name of the import namespace used to import from the `baseTypesPath` file.
180
-
* @default Types
180
+
* @default Types (if `baseTypesPath` is set)
181
181
*
182
182
* @exampleMarkdown
183
183
* ```ts filename="codegen.ts" {11}
@@ -200,6 +200,30 @@ export type NearOperationFileConfig = {
200
200
* ```
201
201
*/
202
202
importTypesNamespace?: string;
203
+
204
+
/**
205
+
* @description Optional, generates one file per operation, using the operation name as the filename. Note: if your documents are in `.graphql` files and there are multiple operations or fragments in a single file, the generated filename will be based on the first operation or fragment found.
206
+
* @default false
207
+
*
208
+
* @exampleMarkdown
209
+
* ```ts filename="codegen.ts" {11}
210
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
(options.presetConfig.baseTypesPath ? 'Types' : undefined);// When there is `baseTypesPath`, we assume there'd be a type import, so we default `importTypesNamespace` value to `Types` for convenience.
0 commit comments