-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathconfig.schema.json
4985 lines (4985 loc) · 356 KB
/
config.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"Types.Config": {
"description": "Represents the root YAML schema for the config file.",
"additionalProperties": false,
"type": "object",
"properties": {
"schema": {
"$ref": "#/definitions/Types.InstanceOrArray",
"description": "A pointer(s) to your GraphQL schema. This schema will be the base schema for all your outputs.\nYou can use one of the following:\n\n- URL pointing to a GraphQL endpoint\n- Path to a local `.json` file\n- Path to a local `.graphql` file\n- Glob expression pointing to multiple `.graphql` files\n- Path to a local code file (for example: `.js`) that exports `GraphQLSchema` object\n- Inline string containing GraphQL SDL schema definition\n\nYou can specify either a single schema, or multiple, and GraphQL Code Generator will merge the schemas into a single schema.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/schema-field"
},
"require": {
"$ref": "#/definitions/Types.RequireExtension",
"description": "A path to a file which defines custom Node.JS require() handlers for custom file extensions.\nThis is essential if the code generator has to go through files which require other files in an unsupported format (by default).\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/require-field\nSee more information about require.extensions: https://gist.github.com/jamestalmage/df922691475cff66c7e6.\n\nNote: values that specified in your .yml file will get loaded after loading the config .yml file."
},
"customFetch": {
"description": "Name for a library that implements `fetch`.\nUse this to tell codegen to use that to fetch schemas in a custom way.",
"type": "string"
},
"documents": {
"$ref": "#/definitions/Types.InstanceOrArray_1",
"description": "A pointer(s) to your GraphQL documents: query, mutation, subscription and fragment. These documents will be loaded into for all your output files.\nYou can use one of the following:\n\n- Path to a local `.graphql` file\n- Path to a code file (for example: `.js` or `.tsx`) containing GraphQL operation strings.\n- Glob expression pointing to multiple `.graphql` files\n- Glob expression pointing to multiple code files\n- Inline string containing GraphQL SDL operation definition\n\nYou can specify either a single file, or multiple.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/documents-field"
},
"config": {
"type": "object",
"additionalProperties": true,
"description": "Configuration object containing key => value that will be passes to the plugins.\nSpecifying configuration in this level of your configuration file will pass it to all plugins, in all outputs.\n\nThe options may vary depends on what plugins you are using.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/config-field"
},
"generates": {
"description": "A map where the key represents an output path for the generated code and the value represents a set of options which are relevant for that specific file.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/codegen-config",
"type": "object",
"additionalProperties": {
"anyOf": [
{ "type": "array", "items": { "$ref": "#/definitions/Types.ConfiguredPlugin" } },
{ "$ref": "#/definitions/Types.ConfiguredOutput" }
]
}
},
"overwrite": {
"description": "A flag to overwrite files if they already exist when generating code (`true` by default).\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/codegen-config",
"type": "boolean"
},
"watch": {
"description": "A flag to trigger codegen when there are changes in the specified GraphQL schemas.\n\nYou can either specify a boolean to turn it on/off or specify an array of glob patterns to add custom files to the watch.\n\nFor more details: https://graphql-code-generator.com/docs/getting-started/development-workflow#watch-mode",
"anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": ["string", "boolean"] }]
},
"watchConfig": {
"description": "Allows overriding the behavior of watch to use stat polling over native file watching support.\n\nConfig fields have the same defaults and sematics as the identically named ones for chokidar.\n\nFor more details: https://graphql-code-generator.com/docs/getting-started/development-workflow#watch-mode",
"type": "object",
"properties": { "usePolling": { "type": "boolean" }, "interval": { "type": "number" } }
},
"ignoreNoDocuments": {
"description": "A flag to suppress non-zero exit code when there are no documents to generate.",
"type": "boolean"
},
"emitLegacyCommonJSImports": {
"description": "A flag to disable adding `.js` extension to the output file. Default: `true`.",
"type": "boolean"
},
"silent": { "description": "A flag to suppress printing errors when they occur.", "type": "boolean" },
"verbose": { "description": "A flag to output more detailed information about tasks", "type": "boolean" },
"debug": { "description": "A flag to output debug logs", "type": "boolean" },
"errorsOnly": { "description": "A flag to print only errors.", "type": "boolean" },
"pluginLoader": {
"$ref": "#/definitions/Types.PackageLoaderFn",
"description": "If you are using the programmatic API in a browser environment, you can override this configuration to load your plugins in a way different than require."
},
"pluginContext": {
"description": "Additional context passed to plugins",
"type": "object",
"additionalProperties": {}
},
"pluckConfig": {
"description": "Allows you to override the configuration for `@graphql-tools/graphql-tag-pluck`, the tool that extracts your GraphQL operations from your code files.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/documents-field#graphql-tag-pluck",
"type": "object",
"properties": {
"modules": {
"$ref": "#/definitions/Array",
"description": "An array of package name and identifier that will be used to track down your gql usages and imports. Use this if your code files imports gql from another library or you have a custom gql tag. identifier is the named export, so don't provide it if the tag function is imported as default."
},
"gqlMagicComment": {
"description": "Configures the magic GraphQL comments to look for. The default is `GraphQL`.",
"type": "string"
},
"globalIdentifier": {
"description": "Overrides the name of the default GraphQL name identifier.",
"type": "string"
},
"globalGqlIdentifierName": {
"description": "Allows to use a global identifier instead of a module import.",
"anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "string" }]
}
}
},
"hooks": {
"$ref": "#/definitions/Partial",
"description": "Specifies scripts to run when events are happening in the codegen core.\nHooks defined on that level will effect all output files.\n\nFor more details: https://graphql-code-generator.com/docs/config-reference/lifecycle-hooks"
},
"noSilentErrors": {
"description": "Alows to raise errors if any matched files are not valid GraphQL. Default: false.",
"type": "boolean"
}
}
},
"FlutterFreezedPluginConfig": {
"description": "configure the `flutter-freezed` plugin",
"type": "object",
"properties": {
"camelCasedEnums": {
"type": "{(boolean | DartIdentifierCasing)}",
"description": "Setting this option to `true` will camelCase enum values as required by Dart's recommended linter.\n\nIf set to false, the original casing as specified in the Graphql Schema is used\n\nYou can also transform the casing by specifying your preferred casing for Enum values.\n\nAvailable options are: `'snake_case'`, `'camelCase'` and `'PascalCase'`\n\nFor consistency, this option applies the same configuration to all Enum Types in the GraphQL Schema\nDefault value: \"true\""
},
"copyWith": {
"type": "{(boolean | TypeNamePattern)}",
"description": "The [`freezed`](https://pub.dev/packages/freezed) library has this option enabled by default.\nUse this option to enable/disable this option completely.\n\nThe plugin by default generates immutable Freezed models using the `@freezed` decorator.\n\nIf this option is configured, the plugin will generate immutable Freezed models using the `@Freezed(copyWith: value)` instead.\n\nSetting a boolean value will enable/disable this option globally for every GraphQL Type\nbut you can also set this option to `true` for one or more GraphQL Types using a `TypeNamePattern`.\nDefault value: \"undefined\""
},
"customScalars": {
"type": "{(Record<string, string>)}",
"description": "The `key` is the GraphQL Scalar Type and the `value` is the equivalent Dart Type\n\nThe plugin automatically handles built-in GraphQL Scalar Types so only specify the custom Scalars in your Graphql Schema.\nDefault value: \"[object Object]\""
},
"defaultValues": {
"type": "{([pattern: FieldNamePattern, value: string, appliesOn: AppliesOnParameters[]][])}",
"description": "This will annotate the generated parameter with a `@Default(value: defaultValue)` decorator.\n\nThe default value will be interpolated into the `@Default(value: ${value})` decorator so\nUse backticks for the value element so that you can use quotation marks for string values.\nE.g: `\"I'm a string default value\"` but `Episode.jedi` is not a string value.\n\nUse the `appliesOn` to specify where this option should be applied on\nDefault value: \"undefined\""
},
"deprecated": {
"type": "{([pattern: Pattern, appliesOn: (AppliesOnFactory | AppliesOnParameters)[]][])}",
"description": "Using a TypeNamePattern, you can mark an entire factory constructor for one or more GraphQL types as deprecated.\n\nLikewise, using a FieldNamePattern, you can mark one or more fields as deprecated\n\nSince the first element in the tuple has a type signature of `Pattern`,\nyou can use either TypeNamePattern or FieldNamePattern or use both\nby composing them with `Pattern.compose(...)`\n\nUse the `appliesOn` to specify which block this option should be applied on\nDefault value: \"undefined\""
},
"equal": {
"type": "{(boolean | TypeNamePattern)}",
"description": "The [`freezed`](https://pub.dev/packages/freezed) library has this option enabled by default.\nUse this option to enable/disable this option completely.\n\nThe plugin by default generates immutable Freezed models using the `@freezed` decorator.\n\nIf this option is configured, the plugin will generate immutable Freezed models using the `@Freezed(equal: value)` instead.\n\nSetting a boolean value will enable/disable this option globally for every GraphQL Type\nbut you can also set this option to `true` for one or more GraphQL Types using a `TypeNamePattern`.\nDefault value: \"undefined\""
},
"escapeDartKeywords": {
"type": "{(boolean | [pattern: Pattern, prefix?: string, suffix?: string, appliesOn?: AppliesOn[]][])}",
"description": "Wraps the fields names that are valid Dart keywords with the prefix and suffix given\nDefault value: \"true\""
},
"final": {
"type": "{([pattern: FieldNamePattern, appliesOn: AppliesOnParameters[]][])}",
"description": "This will mark the specified parameters as final\nDefault value: \"undefined\""
},
"ignoreTypes": {
"type": "{(TypeNamePattern)}",
"description": "names of GraphQL types to ignore when generating Freezed classes\nDefault value: \"undefined\""
},
"immutable": {
"type": "{(boolean | TypeNamePattern)}",
"description": "The [`freezed`](https://pub.dev/packages/freezed) library by default generates immutable models decorated with the `@freezed` decorator.\nThis option if set to `false` the plugin will generate mutable Freezed models using the `@unfreezed` decorator instead.\n\nSetting a boolean value will enable/disable this option globally for every GraphQL Type\nbut you can also set this option to `true` for one or more GraphQL Types using a `TypeNamePattern`.\nDefault value: \"undefined\""
},
"makeCollectionsUnmodifiable": {
"type": "{(boolean | TypeNamePattern)}",
"description": "allows collections(lists/maps) to be modified even if class is immutable\nDefault value: \"undefined\""
},
"mergeTypes": {
"type": "{(Record<string, TypeName[]>)}",
"description": "maps over the value(array of typeNames) and transform each as a named factory constructor inside a class generated for the key(target GraphQL Object Type).\nDefault value: \"undefined\""
},
"mutableInputs": {
"description": "since inputs will be used to collect data, it makes sense to make them mutable with Freezed's `@unfreezed` decorator.\n\nThis overrides(in order words: has a higher precedence than) the `immutable` config value `ONLY` for GraphQL `input types`.\nDefault value: \"true\"",
"anyOf": [{ "$ref": "#/definitions/TypeNamePattern" }, { "type": "boolean" }]
},
"privateEmptyConstructor": {
"description": "if true, defines a private empty constructor to allow getter and methods to work on the class\nDefault value: \"true\"",
"anyOf": [{ "$ref": "#/definitions/TypeNamePattern" }, { "type": "boolean" }]
},
"unionClass": {
"description": "customize the key to be used for fromJson with multiple constructors\nDefault value: \"undefined\"",
"type": "array",
"items": {
"type": "array",
"items": [
{ "$ref": "#/definitions/TypeNamePattern" },
{ "type": "string" },
{ "$ref": "#/definitions/UnionValueCase" },
{
"type": "array",
"items": {
"type": "array",
"items": [{ "$ref": "#/definitions/TypeName" }, { "type": "string" }],
"minItems": 2,
"maxItems": 2
}
}
],
"minItems": 1,
"maxItems": 4
}
}
}
},
"ReactQueryRawPluginConfig": {
"description": "This plugin generates `React-Query` Hooks with TypeScript typings.\n\nIt extends the basic TypeScript plugins: `@graphql-codegen/typescript`, `@graphql-codegen/typescript-operations` - and thus shares a similar configuration.\n\n> **If you are using the `react-query` package instead of the `@tanstack/react-query` package in your project, please set the `legacyMode` option to `true`.**",
"type": "object",
"properties": {
"fetcher": {
"description": "Customize the fetcher you wish to use in the generated file. React-Query is agnostic to the data-fetching layer, so you should provide it, or use a custom one.\n\nThe following options are available to use:\n\n- 'fetch' - requires you to specify endpoint and headers on each call, and uses `fetch` to do the actual http call.\n- `{ endpoint: string, fetchParams: RequestInit }`: hardcode your endpoint and fetch options into the generated output, using the environment `fetch` method. You can also use `process.env.MY_VAR` as endpoint or header value.\n- `file#identifier` - You can use custom fetcher method that should implement the exported `ReactQueryFetcher` interface. Example: `./my-fetcher#myCustomFetcher`.\n- `graphql-request`: Will generate each hook with `client` argument, where you should pass your own `GraphQLClient` (created from `graphql-request`).",
"anyOf": [
{ "$ref": "#/definitions/HardcodedFetch" },
{ "type": "object", "properties": { "func": { "type": "string" }, "isReactHook": { "type": "boolean" } } },
{ "type": "string" }
]
},
"exposeDocument": {
"description": "For each generate query hook adds `document` field with a\ncorresponding GraphQL query. Useful for `queryClient.fetchQuery`.\nDefault value: \"false\"",
"type": "boolean"
},
"exposeQueryKeys": {
"description": "For each generate query hook adds getKey(variables: QueryVariables) function. Useful for cache updates. If addInfiniteQuery is true, it will also add a getKey function to each infinite query.\nDefault value: \"false\"",
"type": "boolean"
},
"exposeMutationKeys": {
"description": "For each generate mutation hook adds getKey() function. Useful for call outside of functional component.\nDefault value: \"false\"",
"type": "boolean"
},
"exposeFetcher": {
"description": "For each generate query hook adds `fetcher` field with a corresponding GraphQL query using the fetcher.\nIt is useful for `queryClient.fetchQuery` and `queryClient.prefetchQuery`.\nDefault value: \"false\"",
"type": "boolean"
},
"errorType": {
"description": "Changes the default \"TError\" generic type.\nDefault value: \"unknown\"",
"type": "string"
},
"addInfiniteQuery": {
"description": "Adds an Infinite Query along side the standard one\nDefault value: \"false\"",
"type": "boolean"
},
"legacyMode": {
"description": "If false, it will work with `@tanstack/react-query`, default value is true.\nDefault value: \"true\"",
"type": "boolean"
},
"namingConvention": {
"$ref": "#/definitions/NamingConvention",
"description": "Allow you to override the naming convention of the output.\nYou can either override all namings, or specify an object with specific custom naming convention per output.\nThe format of the converter must be a valid `module#method`.\nAllowed values for specific output are: `typeNames`, `enumValues`.\nYou can also use \"keep\" to keep all GraphQL names as-is.\nAdditionally, you can set `transformUnderscore` to `true` if you want to override the default behavior,\nwhich is to preserve underscores.\n\nAvailable case functions in `change-case-all` are `camelCase`, `capitalCase`, `constantCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`, `lowerCase`, `localeLowerCase`, `lowerCaseFirst`, `spongeCase`, `titleCase`, `upperCase`, `localeUpperCase` and `upperCaseFirst`\n[See more](https://github.com/btxtiger/change-case-all)\nDefault value: \"change-case-all#pascalCase\""
},
"operationResultSuffix": {
"description": "Adds a suffix to generated operation result type names\nDefault value: \"\"",
"type": "string"
},
"dedupeOperationSuffix": {
"description": "Set this configuration to `true` if you wish to make sure to remove duplicate operation name suffix.\nDefault value: \"false\"",
"type": "boolean"
},
"omitOperationSuffix": {
"description": "Set this configuration to `true` if you wish to disable auto add suffix of operation name, like `Query`, `Mutation`, `Subscription`, `Fragment`.\nDefault value: \"false\"",
"type": "boolean"
},
"documentVariablePrefix": {
"description": "Changes the GraphQL operations variables prefix.\nDefault value: \"\"",
"type": "string"
},
"documentVariableSuffix": {
"description": "Changes the GraphQL operations variables suffix.\nDefault value: \"Document\"",
"type": "string"
},
"fragmentVariablePrefix": {
"description": "Changes the GraphQL fragments variables prefix.\nDefault value: \"\"",
"type": "string"
},
"fragmentVariableSuffix": {
"description": "Changes the GraphQL fragments variables suffix.\nDefault value: \"FragmentDoc\"",
"type": "string"
},
"pureMagicComment": {
"description": "This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler.\nDefault value: \"false\"",
"type": "boolean"
},
"optimizeDocumentNode": {
"description": "If you are using `documentNode: documentMode | documentNodeImportFragments`, you can set this to `true` to apply document optimizations for your GraphQL document.\nThis will remove all \"loc\" and \"description\" fields from the compiled document, and will remove all empty arrays (such as `directives`, `arguments` and `variableDefinitions`).\nDefault value: \"true\"",
"type": "boolean"
},
"experimentalFragmentVariables": {
"description": "If set to true, it will enable support for parsing variables on fragments.\nDefault value: \"false\"",
"type": "boolean"
},
"scalars": {
"$ref": "#/definitions/ScalarsMap",
"description": "Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type."
},
"typesPrefix": { "description": "Prefixes all the generated types.\nDefault value: \"\"", "type": "string" },
"typesSuffix": { "description": "Suffixes all the generated types.\nDefault value: \"\"", "type": "string" },
"nonOptionalTypename": {
"description": "Automatically adds `__typename` field to the generated types, even when they are not specified\nin the selection set, and makes it non-optional\nDefault value: \"false\"",
"type": "boolean"
},
"dedupeFragments": {
"description": "Removes fragment duplicates for reducing data transfer.\nIt is done by removing sub-fragments imports from fragment definition\nInstead - all of them are imported to the Operation node.\nDefault value: \"false\"",
"type": "boolean"
},
"inlineFragmentTypes": {
"description": "Whether fragment types should be inlined into other operations.\n\"inline\" is the default behavior and will perform deep inlining fragment types within operation type definitions.\n\"combine\" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types).\nDefault value: \"inline\"",
"type": "string"
},
"emitLegacyCommonJSImports": {
"description": "Emit legacy common js imports.\nDefault it will be `true` this way it ensure that generated code works with [non-compliant bundlers](https://github.com/dotansimha/graphql-code-generator/issues/8065).\nDefault value: \"true\"",
"type": "boolean"
},
"strictScalars": {
"description": "Makes scalars strict.\n\nIf scalars are found in the schema that are not defined in `scalars`\nan error will be thrown during codegen.\nDefault value: \"false\"",
"type": "boolean"
},
"defaultScalarType": {
"description": "Allows you to override the type that unknown scalars will have.\nDefault value: \"any\"",
"type": "string"
},
"skipTypename": {
"description": "Does not add `__typename` to the generated types, unless it was specified in the selection set.\nDefault value: \"false\"",
"type": "boolean"
}
}
},
"RTKConfig": {
"type": "object",
"properties": {
"importBaseApiFrom": {
"description": "Define where to import the base api to inject endpoints into",
"type": "string"
},
"importBaseApiAlternateName": {
"description": "Change the import name of the baseApi from default 'api'\nDefault value: \"'api'\"",
"type": "string"
},
"exportHooks": {
"description": "Whether to export React Hooks from the generated api. Enable only when using the `\"@reduxjs/toolkit/query/react\"` import of `createApi`\nDefault value: \"false\"",
"type": "boolean"
},
"overrideExisting": {
"description": "Sets the `overrideExisting` option, for example to allow for hot module reloading when running graphql-codegen in watch mode.\nWill directly be injected as code.\nDefault value: \"undefined\"",
"type": "string"
}
}
},
"RawGenericSdkPluginConfig": {
"description": "This plugin generate a generic SDK (without any Requester implemented), allow you to easily customize the way you fetch your data, without loosing the strongly-typed integration.",
"type": "object",
"properties": {
"usingObservableFrom": {
"description": "usingObservableFrom: `import Observable from 'zen-observable'`\nOR\nusingObservableFrom: `import { Observable } from 'rxjs'`",
"type": "string"
},
"rawRequest": {
"description": "By default the `request` method return the `data` or `errors` key from the response. If you need to access the `extensions` key you can use the `rawRequest` method.\nDefault value: \"false\"",
"type": "boolean"
},
"noGraphQLTag": {
"description": "Deprecated. Changes the documentMode to `documentNode`.\nDefault value: \"false\"",
"type": "boolean"
},
"gqlImport": {
"description": "Customize from which module will `gql` be imported from.\nThis is useful if you want to use modules other than `graphql-tag`, e.g. `graphql.macro`.\nDefault value: \"graphql-tag#gql\"",
"type": "string"
},
"documentNodeImport": {
"description": "Customize from which module will `DocumentNode` be imported from.\nThis is useful if you want to use modules other than `graphql`, e.g. `@graphql-typed-document-node`.\nDefault value: \"graphql#DocumentNode\"",
"type": "string"
},
"noExport": {
"description": "Set this configuration to `true` if you wish to tell codegen to generate code with no `export` identifier.\nDefault value: \"false\"",
"type": "boolean"
},
"dedupeOperationSuffix": {
"description": "Set this configuration to `true` if you wish to make sure to remove duplicate operation name suffix.\nDefault value: \"false\"",
"type": "boolean"
},
"omitOperationSuffix": {
"description": "Set this configuration to `true` if you wish to disable auto add suffix of operation name, like `Query`, `Mutation`, `Subscription`, `Fragment`.\nDefault value: \"false\"",
"type": "boolean"
},
"operationResultSuffix": {
"description": "Adds a suffix to generated operation result type names\nDefault value: \"\"",
"type": "string"
},
"documentVariablePrefix": {
"description": "Changes the GraphQL operations variables prefix.\nDefault value: \"\"",
"type": "string"
},
"documentVariableSuffix": {
"description": "Changes the GraphQL operations variables suffix.\nDefault value: \"Document\"",
"type": "string"
},
"fragmentVariablePrefix": {
"description": "Changes the GraphQL fragments variables prefix.\nDefault value: \"\"",
"type": "string"
},
"fragmentVariableSuffix": {
"description": "Changes the GraphQL fragments variables suffix.\nDefault value: \"FragmentDoc\"",
"type": "string"
},
"documentMode": {
"$ref": "#/definitions/DocumentMode",
"description": "Declares how DocumentNode are created:\n\n- `graphQLTag`: `graphql-tag` or other modules (check `gqlImport`) will be used to generate document nodes. If this is used, document nodes are generated on client side i.e. the module used to generate this will be shipped to the client\n- `documentNode`: document nodes will be generated as objects when we generate the templates.\n- `documentNodeImportFragments`: Similar to documentNode except it imports external fragments instead of embedding them.\n- `external`: document nodes are imported from an external file. To be used with `importDocumentNodeExternallyFrom`\n\nNote that some plugins (like `typescript-graphql-request`) also supports `string` for this parameter.\nDefault value: \"graphQLTag\""
},
"optimizeDocumentNode": {
"description": "If you are using `documentNode: documentMode | documentNodeImportFragments`, you can set this to `true` to apply document optimizations for your GraphQL document.\nThis will remove all \"loc\" and \"description\" fields from the compiled document, and will remove all empty arrays (such as `directives`, `arguments` and `variableDefinitions`).\nDefault value: \"true\"",
"type": "boolean"
},
"importOperationTypesFrom": {
"description": "This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using.\nThis is useful if you wish to generate base types from `typescript-operations` plugin into a different file, and import it from there.\nDefault value: \"\"",
"type": "string"
},
"importDocumentNodeExternallyFrom": {
"description": "This config should be used if `documentMode` is `external`. This has 2 usage:\n\n- any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use `graphql-tag` in a separate file and export the generated document\n- 'near-operation-file': This is a special mode that is intended to be used with `near-operation-file` preset to import document nodes from those files. If these files are `.graphql` files, we make use of webpack loader.\nDefault value: \"\"",
"type": "string"
},
"pureMagicComment": {
"description": "This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler.\nDefault value: \"false\"",
"type": "boolean"
},
"experimentalFragmentVariables": {
"description": "If set to true, it will enable support for parsing variables on fragments.\nDefault value: \"false\"",
"type": "boolean"
},
"strictScalars": {
"description": "Makes scalars strict.\n\nIf scalars are found in the schema that are not defined in `scalars`\nan error will be thrown during codegen.\nDefault value: \"false\"",
"type": "boolean"
},
"defaultScalarType": {
"description": "Allows you to override the type that unknown scalars will have.\nDefault value: \"any\"",
"type": "string"
},
"scalars": {
"$ref": "#/definitions/ScalarsMap",
"description": "Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type."
},
"namingConvention": {
"$ref": "#/definitions/NamingConvention",
"description": "Allow you to override the naming convention of the output.\nYou can either override all namings, or specify an object with specific custom naming convention per output.\nThe format of the converter must be a valid `module#method`.\nAllowed values for specific output are: `typeNames`, `enumValues`.\nYou can also use \"keep\" to keep all GraphQL names as-is.\nAdditionally, you can set `transformUnderscore` to `true` if you want to override the default behavior,\nwhich is to preserve underscores.\n\nAvailable case functions in `change-case-all` are `camelCase`, `capitalCase`, `constantCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`, `lowerCase`, `localeLowerCase`, `lowerCaseFirst`, `spongeCase`, `titleCase`, `upperCase`, `localeUpperCase` and `upperCaseFirst`\n[See more](https://github.com/btxtiger/change-case-all)\nDefault value: \"change-case-all#pascalCase\""
},
"typesPrefix": { "description": "Prefixes all the generated types.\nDefault value: \"\"", "type": "string" },
"typesSuffix": { "description": "Suffixes all the generated types.\nDefault value: \"\"", "type": "string" },
"skipTypename": {
"description": "Does not add `__typename` to the generated types, unless it was specified in the selection set.\nDefault value: \"false\"",
"type": "boolean"
},
"nonOptionalTypename": {
"description": "Automatically adds `__typename` field to the generated types, even when they are not specified\nin the selection set, and makes it non-optional\nDefault value: \"false\"",
"type": "boolean"
},
"useTypeImports": {
"type": "boolean",
"description": "Will use `import type {}` rather than `import {}` when importing only types. This gives\ncompatibility with TypeScript's \"importsNotUsedAsValues\": \"error\" option\nDefault value: \"false\""
},
"dedupeFragments": {
"description": "Removes fragment duplicates for reducing data transfer.\nIt is done by removing sub-fragments imports from fragment definition\nInstead - all of them are imported to the Operation node.\nDefault value: \"false\"",
"type": "boolean"
},
"inlineFragmentTypes": {
"description": "Whether fragment types should be inlined into other operations.\n\"inline\" is the default behavior and will perform deep inlining fragment types within operation type definitions.\n\"combine\" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types).\nDefault value: \"inline\"",
"type": "string"
},
"emitLegacyCommonJSImports": {
"description": "Emit legacy common js imports.\nDefault it will be `true` this way it ensure that generated code works with [non-compliant bundlers](https://github.com/dotansimha/graphql-code-generator/issues/8065).\nDefault value: \"true\"",
"type": "boolean"
}
}
},
"ApolloClientHelpersConfig": {
"type": "object",
"properties": {
"useTypeImports": {
"type": "boolean",
"description": "Will use `import type {}` rather than `import {}` when importing only types. This gives\ncompatibility with TypeScript's \"importsNotUsedAsValues\": \"error\" option\nDefault value: \"false\""
},
"requireKeyFields": {
"type": "boolean",
"description": "Remove optional sign from all `keyFields` fields.\nDefault value: \"false\""
},
"requirePoliciesForAllTypes": {
"type": "boolean",
"description": "Remove optional sign from all generated keys of the root TypePolicy.\nDefault value: \"false\""
}
}
},
"AddPluginConfig": {
"type": "object",
"properties": {
"placement": {
"description": "Allow you to choose where to add the content.\nDefault value: \"prepend\"",
"enum": ["append", "content", "prepend"],
"type": "string"
},
"content": {
"description": "The actual content you wish to add, either a string or array of strings.\nYou can also specify a path to a local file and the content if it will be loaded by codegen.",
"anyOf": [{ "type": "array", "items": { "type": "string" } }, { "type": "string" }]
}
}
},
"TimePluginConfig": {
"type": "object",
"properties": {
"format": {
"description": "Customize the Moment format of the output time.\nDefault value: \"YYYY-MM-DDTHH:mm:ssZ\"",
"type": "string"
},
"message": {
"description": "Customize the comment message\nDefault value: \"'Generated on'\"",
"type": "string"
}
}
},
"TypeScriptPluginConfig": {
"description": "This plugin generates the base TypeScript types, based on your GraphQL schema.\n\nThe types generated by this plugin are simple, and refers to the exact structure of your schema, and it's used as the base types for other plugins (such as `typescript-operations` / `typescript-resolvers`)",
"type": "object",
"properties": {
"avoidOptionals": {
"description": "This will cause the generator to avoid using TypeScript optionals (`?`) on types,\nso the following definition: `type A { myField: String }` will output `myField: Maybe<string>`\ninstead of `myField?: Maybe<string>`.\nDefault value: \"false\"",
"anyOf": [{ "$ref": "#/definitions/AvoidOptionalsConfig" }, { "type": "boolean" }]
},
"constEnums": {
"description": "Will prefix every generated `enum` with `const`, you can read more about const enums here: https://www.typescriptlang.org/docs/handbook/enums.html.\nDefault value: \"false\"",
"type": "boolean"
},
"enumsAsTypes": {
"description": "Generates enum as TypeScript string union `type` instead of an `enum`. Useful if you wish to generate `.d.ts` declaration file instead of `.ts`, or if you want to avoid using TypeScript enums due to bundle size concerns\nDefault value: \"false\"",
"type": "boolean"
},
"numericEnums": {
"description": "Controls whether to preserve typescript enum values as numbers\nDefault value: \"false\"",
"type": "boolean"
},
"futureProofEnums": {
"description": "This option controls whether or not a catch-all entry is added to enum type definitions for values that may be added in the future.\nThis is useful if you are using `relay`.\nDefault value: \"false\"",
"type": "boolean"
},
"futureProofUnions": {
"description": "This option controls whether or not a catch-all entry is added to union type definitions for values that may be added in the future.\nThis is useful if you are using `relay`.\nDefault value: \"false\"",
"type": "boolean"
},
"enumsAsConst": {
"description": "Generates enum as TypeScript `const assertions` instead of `enum`. This can even be used to enable enum-like patterns in plain JavaScript code if you choose not to use TypeScript’s enum construct.\nDefault value: \"false\"",
"type": "boolean"
},
"onlyEnums": {
"description": "This will cause the generator to emit types for enums only.\nDefault value: \"false\"",
"type": "boolean"
},
"onlyOperationTypes": {
"description": "This will cause the generator to emit types for operations only (basically only enums and scalars).\nInteracts well with `preResolveTypes: true`\nDefault value: \"false\"",
"type": "boolean"
},
"immutableTypes": {
"description": "Generates immutable types by adding `readonly` to properties and uses `ReadonlyArray`.\nDefault value: \"false\"",
"type": "boolean"
},
"maybeValue": {
"description": "Allow to override the type value of `Maybe`.\nDefault value: \"T | null\"",
"type": "string"
},
"inputMaybeValue": {
"description": "Allow to override the type value of `Maybe` for input types and arguments.\nThis is useful in case you want to differentiate between the wrapper of input and output types.\nBy default, this type just refers to `Maybe` type, but you can override its definition.\nDefault value: \"Maybe<T>\"",
"type": "string"
},
"noExport": {
"description": "Set to `true` in order to generate output without `export` modifier.\nThis is useful if you are generating `.d.ts` file and want it to be globally available.\nDefault value: \"false\"",
"type": "boolean"
},
"disableDescriptions": {
"description": "Set the value to `true` in order to disable all description generation.\nDefault value: \"false\"",
"type": "boolean"
},
"useImplementingTypes": {
"description": "When a GraphQL interface is used for a field, this flag will use the implementing types, instead of the interface itself.\nDefault value: \"false\"",
"type": "boolean"
},
"wrapEntireFieldDefinitions": {
"type": "boolean",
"description": "Set to `true` in order to wrap field definitions with `EntireFieldWrapper`.\nThis is useful to allow return types such as Promises and functions for fields.\nDiffers from `wrapFieldDefinitions` in that this wraps the entire field definition if i.e. the field is an Array, while\n`wrapFieldDefinitions` will wrap every single value inside the array.\nDefault value: \"false\""
},
"entireFieldWrapperValue": {
"type": "string",
"description": "Allow to override the type value of `EntireFieldWrapper`. This wrapper applies outside of Array and Maybe\nunlike `fieldWrapperValue`, that will wrap the inner type.\nDefault value: \"T | Promise<T> | (() => T | Promise<T>)\""
},
"allowEnumStringTypes": { "description": "Allow using enum string values directly.", "type": "boolean" },
"addUnderscoreToArgsType": {
"description": "Adds `_` to generated `Args` types in order to avoid duplicate identifiers.",
"type": "boolean"
},
"enumValues": {
"$ref": "#/definitions/EnumValuesMap",
"description": "Overrides the default value of enum values declared in your GraphQL schema.\nYou can also map the entire enum to an external type by providing a string that of `module#type`."
},
"declarationKind": {
"description": "Overrides the default output for various GraphQL elements.",
"anyOf": [
{ "$ref": "#/definitions/DeclarationKindConfig" },
{ "enum": ["abstract class", "class", "interface", "type"], "type": "string" }
]
},
"enumPrefix": {
"description": "Allow you to disable prefixing for generated enums, works in combination with `typesPrefix`.\nDefault value: \"true\"",
"type": "boolean"
},
"enumSuffix": {
"description": "Allow you to disable suffixing for generated enums, works in combination with `typesSuffix`.\nDefault value: \"true\"",
"type": "boolean"
},
"fieldWrapperValue": {
"description": "Allow you to add wrapper for field type, use T as the generic value. Make sure to set `wrapFieldDefinitions` to `true` in order to make this flag work.\nDefault value: \"T\"",
"type": "string"
},
"wrapFieldDefinitions": {
"description": "Set to `true` in order to wrap field definitions with `FieldWrapper`.\nThis is useful to allow return types such as Promises and functions.\nDefault value: \"false\"",
"type": "boolean"
},
"ignoreEnumValuesFromSchema": {
"description": "This will cause the generator to ignore enum values defined in GraphQLSchema\nDefault value: \"false\"",
"type": "boolean"
},
"directiveArgumentAndInputFieldMappings": {
"$ref": "#/definitions/DirectiveArgumentAndInputFieldMappings",
"description": "Replaces a GraphQL scalar with a custom type based on the applied directive on an argument or input field.\n\nYou can use both `module#type` and `module#namespace#type` syntax.\nWill NOT work with introspected schemas since directives are not exported.\nOnly works with directives on ARGUMENT_DEFINITION or INPUT_FIELD_DEFINITION.\n\n**WARNING:** Using this option does only change the type definitions.\n\nFor actually ensuring that a type is correct at runtime you will have to use schema transforms (e.g. with [@graphql-tools/utils mapSchema](https://graphql-tools.com/docs/schema-directives)) that apply those rules!\nOtherwise, you might end up with a runtime type mismatch which could cause unnoticed bugs or runtime errors.\n\nPlease use this configuration option with care!"
},
"directiveArgumentAndInputFieldMappingTypeSuffix": {
"description": "Adds a suffix to the imported names to prevent name clashes.",
"type": "string"
},
"strictScalars": {
"description": "Makes scalars strict.\n\nIf scalars are found in the schema that are not defined in `scalars`\nan error will be thrown during codegen.\nDefault value: \"false\"",
"type": "boolean"
},
"defaultScalarType": {
"description": "Allows you to override the type that unknown scalars will have.\nDefault value: \"any\"",
"type": "string"
},
"scalars": {
"$ref": "#/definitions/ScalarsMap_1",
"description": "Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type."
},
"namingConvention": {
"$ref": "#/definitions/NamingConvention_1",
"description": "Allow you to override the naming convention of the output.\nYou can either override all namings, or specify an object with specific custom naming convention per output.\nThe format of the converter must be a valid `module#method`.\nAllowed values for specific output are: `typeNames`, `enumValues`.\nYou can also use \"keep\" to keep all GraphQL names as-is.\nAdditionally, you can set `transformUnderscore` to `true` if you want to override the default behavior,\nwhich is to preserve underscores.\n\nAvailable case functions in `change-case-all` are `camelCase`, `capitalCase`, `constantCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`, `lowerCase`, `localeLowerCase`, `lowerCaseFirst`, `spongeCase`, `titleCase`, `upperCase`, `localeUpperCase` and `upperCaseFirst`\n[See more](https://github.com/btxtiger/change-case-all)\nDefault value: \"change-case-all#pascalCase\""
},
"typesPrefix": { "description": "Prefixes all the generated types.\nDefault value: \"\"", "type": "string" },
"typesSuffix": { "description": "Suffixes all the generated types.\nDefault value: \"\"", "type": "string" },
"skipTypename": {
"description": "Does not add `__typename` to the generated types, unless it was specified in the selection set.\nDefault value: \"false\"",
"type": "boolean"
},
"nonOptionalTypename": {
"description": "Automatically adds `__typename` field to the generated types, even when they are not specified\nin the selection set, and makes it non-optional\nDefault value: \"false\"",
"type": "boolean"
},
"useTypeImports": {
"type": "boolean",
"description": "Will use `import type {}` rather than `import {}` when importing only types. This gives\ncompatibility with TypeScript's \"importsNotUsedAsValues\": \"error\" option\nDefault value: \"false\""
},
"dedupeFragments": {
"description": "Removes fragment duplicates for reducing data transfer.\nIt is done by removing sub-fragments imports from fragment definition\nInstead - all of them are imported to the Operation node.\nDefault value: \"false\"",
"type": "boolean"
},
"inlineFragmentTypes": {
"description": "Whether fragment types should be inlined into other operations.\n\"inline\" is the default behavior and will perform deep inlining fragment types within operation type definitions.\n\"combine\" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types).\nDefault value: \"inline\"",
"type": "string"
},
"emitLegacyCommonJSImports": {
"description": "Emit legacy common js imports.\nDefault it will be `true` this way it ensure that generated code works with [non-compliant bundlers](https://github.com/dotansimha/graphql-code-generator/issues/8065).\nDefault value: \"true\"",
"type": "boolean"
}
}
},
"TypeScriptDocumentsPluginConfig": {
"description": "This plugin generates TypeScript types based on your GraphQLSchema _and_ your GraphQL operations and fragments.\nIt generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.\n\nNote: In most configurations, this plugin requires you to use `typescript as well, because it depends on its base types.",
"type": "object",
"properties": {
"arrayInputCoercion": {
"description": "The [GraphQL spec](https://spec.graphql.org/draft/#sel-FAHjBJFCAACE_Gh7d)\nallows arrays and a single primitive value for list input. This allows to\ndeactivate that behavior to only accept arrays instead of single values. If\nset to `false`, the definition: `query foo(bar: [Int!]!): Foo` will output\n`bar: Array<Int>` instead of `bar: Array<Int> | Int` for the variable part.\nDefault value: \"true\"",
"type": "boolean"
},
"avoidOptionals": {
"description": "This will cause the generator to avoid using TypeScript optionals (`?`) on types,\nso the following definition: `type A { myField: String }` will output `myField: Maybe<string>`\ninstead of `myField?: Maybe<string>`.\nDefault value: \"false\"",
"anyOf": [{ "$ref": "#/definitions/AvoidOptionalsConfig" }, { "type": "boolean" }]
},
"immutableTypes": {
"description": "Generates immutable types by adding `readonly` to properties and uses `ReadonlyArray`.\nDefault value: \"false\"",
"type": "boolean"
},
"flattenGeneratedTypes": {
"description": "Flatten fragment spread and inline fragments into a simple selection set before generating.\nDefault value: \"false\"",
"type": "boolean"
},
"flattenGeneratedTypesIncludeFragments": {
"description": "Include all fragments types when flattenGeneratedTypes is enabled.\nDefault value: \"false\"",
"type": "boolean"
},
"noExport": {
"description": "Set to `true` in order to generate output without `export` modifier.\nThis is useful if you are generating `.d.ts` file and want it to be globally available.\nDefault value: \"false\"",
"type": "boolean"
},
"globalNamespace": { "type": "boolean" },
"addOperationExport": {
"type": "boolean",
"description": "Add const export of the operation name to output file. Pay attention that the file should be `d.ts`.\nYou can combine it with `near-operation-file preset` and therefore the types will be generated along with graphql file. Then you need to set extension in `presetConfig` to be `.gql.d.ts` and by that you can import `gql` file in `ts` files.\nIt will allow you to get everything with one import:\n\n```ts\nimport { GetClient, GetClientQuery, GetClientQueryVariables } from './GetClient.gql.js'\n```\nDefault value: \"false\""
},
"maybeValue": {
"description": "Allow to override the type value of `Maybe`.\nDefault value: \"T | null\"",
"type": "string"
},
"preResolveTypes": {
"description": "Uses primitive types where possible.\nSet to `false` in order to use `Pick` and take use the types generated by `typescript` plugin.\nDefault value: \"true\"",
"type": "boolean"
},
"skipTypeNameForRoot": {
"description": "Avoid adding `__typename` for root types. This is ignored when a selection explicitly specifies `__typename`.\nDefault value: \"false\"",
"type": "boolean"
},
"operationResultSuffix": {
"description": "Adds a suffix to generated operation result type names\nDefault value: \"\"",
"type": "string"
},
"dedupeOperationSuffix": {
"description": "Set this configuration to `true` if you wish to make sure to remove duplicate operation name suffix.\nDefault value: \"false\"",
"type": "boolean"
},
"omitOperationSuffix": {
"description": "Set this configuration to `true` if you wish to disable auto add suffix of operation name, like `Query`, `Mutation`, `Subscription`, `Fragment`.\nDefault value: \"false\"",
"type": "boolean"
},
"exportFragmentSpreadSubTypes": {
"description": "If set to true, it will export the sub-types created in order to make it easier to access fields declared under fragment spread.\nDefault value: \"false\"",
"type": "boolean"
},
"experimentalFragmentVariables": {
"description": "If set to true, it will enable support for parsing variables on fragments.\nDefault value: \"false\"",
"type": "boolean"
},
"mergeFragmentTypes": {
"description": "If set to true, merge equal fragment interfaces.\nDefault value: \"false\"",
"type": "boolean"
},
"addUnderscoreToArgsType": {
"description": "Adds `_` to generated `Args` types in order to avoid duplicate identifiers.",
"type": "boolean"
},
"enumValues": {
"$ref": "#/definitions/EnumValuesMap",
"description": "Overrides the default value of enum values declared in your GraphQL schema.\nYou can also map the entire enum to an external type by providing a string that of `module#type`."
},
"declarationKind": {
"description": "Overrides the default output for various GraphQL elements.",
"anyOf": [
{ "$ref": "#/definitions/DeclarationKindConfig" },
{ "enum": ["abstract class", "class", "interface", "type"], "type": "string" }
]
},
"enumPrefix": {
"description": "Allow you to disable prefixing for generated enums, works in combination with `typesPrefix`.\nDefault value: \"true\"",
"type": "boolean"
},
"enumSuffix": {
"description": "Allow you to disable suffixing for generated enums, works in combination with `typesSuffix`.\nDefault value: \"true\"",
"type": "boolean"
},
"fieldWrapperValue": {
"description": "Allow you to add wrapper for field type, use T as the generic value. Make sure to set `wrapFieldDefinitions` to `true` in order to make this flag work.\nDefault value: \"T\"",
"type": "string"
},
"wrapFieldDefinitions": {
"description": "Set to `true` in order to wrap field definitions with `FieldWrapper`.\nThis is useful to allow return types such as Promises and functions.\nDefault value: \"false\"",
"type": "boolean"
},
"onlyEnums": {
"description": "This will cause the generator to emit types for enums only\nDefault value: \"false\"",
"type": "boolean"
},
"onlyOperationTypes": {
"description": "This will cause the generator to emit types for operations only (basically only enums and scalars)\nDefault value: \"false\"",
"type": "boolean"
},
"ignoreEnumValuesFromSchema": {
"description": "This will cause the generator to ignore enum values defined in GraphQLSchema\nDefault value: \"false\"",
"type": "boolean"
},
"wrapEntireFieldDefinitions": {
"type": "boolean",
"description": "Set to `true` in order to wrap field definitions with `EntireFieldWrapper`.\nThis is useful to allow return types such as Promises and functions for fields.\nDiffers from `wrapFieldDefinitions` in that this wraps the entire field definition if i.e. the field is an Array, while\n`wrapFieldDefinitions` will wrap every single value inside the array.\nDefault value: \"true\""
},
"entireFieldWrapperValue": {
"type": "string",
"description": "Allow to override the type value of `EntireFieldWrapper`. This wrapper applies outside of Array and Maybe\nunlike `fieldWrapperValue`, that will wrap the inner type.\nDefault value: \"T | Promise<T> | (() => T | Promise<T>)\""
},
"directiveArgumentAndInputFieldMappings": {
"$ref": "#/definitions/DirectiveArgumentAndInputFieldMappings",
"description": "Replaces a GraphQL scalar with a custom type based on the applied directive on an argument or input field.\n\nYou can use both `module#type` and `module#namespace#type` syntax.\nWill NOT work with introspected schemas since directives are not exported.\nOnly works with directives on ARGUMENT_DEFINITION or INPUT_FIELD_DEFINITION.\n\n**WARNING:** Using this option does only change the type definitions.\n\nFor actually ensuring that a type is correct at runtime you will have to use schema transforms (e.g. with [@graphql-tools/utils mapSchema](https://graphql-tools.com/docs/schema-directives)) that apply those rules!\nOtherwise, you might end up with a runtime type mismatch which could cause unnoticed bugs or runtime errors.\n\nPlease use this configuration option with care!"
},
"directiveArgumentAndInputFieldMappingTypeSuffix": {
"description": "Adds a suffix to the imported names to prevent name clashes.",
"type": "string"
},
"strictScalars": {
"description": "Makes scalars strict.\n\nIf scalars are found in the schema that are not defined in `scalars`\nan error will be thrown during codegen.\nDefault value: \"false\"",
"type": "boolean"
},
"defaultScalarType": {
"description": "Allows you to override the type that unknown scalars will have.\nDefault value: \"any\"",
"type": "string"
},
"scalars": {
"$ref": "#/definitions/ScalarsMap_1",
"description": "Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type."
},
"namingConvention": {
"$ref": "#/definitions/NamingConvention_1",
"description": "Allow you to override the naming convention of the output.\nYou can either override all namings, or specify an object with specific custom naming convention per output.\nThe format of the converter must be a valid `module#method`.\nAllowed values for specific output are: `typeNames`, `enumValues`.\nYou can also use \"keep\" to keep all GraphQL names as-is.\nAdditionally, you can set `transformUnderscore` to `true` if you want to override the default behavior,\nwhich is to preserve underscores.\n\nAvailable case functions in `change-case-all` are `camelCase`, `capitalCase`, `constantCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`, `lowerCase`, `localeLowerCase`, `lowerCaseFirst`, `spongeCase`, `titleCase`, `upperCase`, `localeUpperCase` and `upperCaseFirst`\n[See more](https://github.com/btxtiger/change-case-all)\nDefault value: \"change-case-all#pascalCase\""
},
"typesPrefix": { "description": "Prefixes all the generated types.\nDefault value: \"\"", "type": "string" },
"typesSuffix": { "description": "Suffixes all the generated types.\nDefault value: \"\"", "type": "string" },
"skipTypename": {
"description": "Does not add `__typename` to the generated types, unless it was specified in the selection set.\nDefault value: \"false\"",
"type": "boolean"
},
"nonOptionalTypename": {
"description": "Automatically adds `__typename` field to the generated types, even when they are not specified\nin the selection set, and makes it non-optional\nDefault value: \"false\"",
"type": "boolean"
},
"useTypeImports": {
"type": "boolean",
"description": "Will use `import type {}` rather than `import {}` when importing only types. This gives\ncompatibility with TypeScript's \"importsNotUsedAsValues\": \"error\" option\nDefault value: \"false\""
},
"dedupeFragments": {
"description": "Removes fragment duplicates for reducing data transfer.\nIt is done by removing sub-fragments imports from fragment definition\nInstead - all of them are imported to the Operation node.\nDefault value: \"false\"",
"type": "boolean"
},
"inlineFragmentTypes": {
"description": "Whether fragment types should be inlined into other operations.\n\"inline\" is the default behavior and will perform deep inlining fragment types within operation type definitions.\n\"combine\" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types).\nDefault value: \"inline\"",
"type": "string"
},
"emitLegacyCommonJSImports": {
"description": "Emit legacy common js imports.\nDefault it will be `true` this way it ensure that generated code works with [non-compliant bundlers](https://github.com/dotansimha/graphql-code-generator/issues/8065).\nDefault value: \"true\"",
"type": "boolean"
}
}
},
"CSharpResolversPluginRawConfig": {
"description": "This plugin generates C# `class` identifier for your schema types.",
"type": "object",
"properties": {
"enumValues": {
"$ref": "#/definitions/EnumValuesMap_1",
"description": "Overrides the default value of enum values declared in your GraphQL schema."
},
"namespaceName": {
"description": "Allow you to customize the namespace name.\nDefault value: \"GraphQLCodeGen\"",
"type": "string"
},
"className": {
"description": "Allow you to customize the parent class name.\nDefault value: \"Types\"",
"type": "string"
},
"listType": {
"description": "Allow you to customize the list type\nDefault value: \"IEnumerable\"",
"type": "string"
},
"emitRecords": {
"description": "Emit C# 9.0+ records instead of classes\nDefault value: \"false\"",
"type": "boolean"
},
"emitJsonAttributes": {
"description": "Should JSON attributes be emitted for produced types and properties ot not\nDefault value: \"true\"",
"type": "boolean"
},
"jsonAttributesSource": {
"$ref": "#/definitions/JsonAttributesSource",
"description": "Library that should be used to emit JSON attributes. Ignored when `emitJsonAttributes` is `false` or not specified\nDefault value: \"Newtonsoft.Json\""
},
"strictScalars": {
"description": "Makes scalars strict.\n\nIf scalars are found in the schema that are not defined in `scalars`\nan error will be thrown during codegen.\nDefault value: \"false\"",
"type": "boolean"
},
"defaultScalarType": {
"description": "Allows you to override the type that unknown scalars will have.\nDefault value: \"any\"",
"type": "string"
},
"scalars": {
"$ref": "#/definitions/ScalarsMap_2",
"description": "Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type."
},
"namingConvention": {
"$ref": "#/definitions/NamingConvention_2",
"description": "Allow you to override the naming convention of the output.\nYou can either override all namings, or specify an object with specific custom naming convention per output.\nThe format of the converter must be a valid `module#method`.\nAllowed values for specific output are: `typeNames`, `enumValues`.\nYou can also use \"keep\" to keep all GraphQL names as-is.\nAdditionally, you can set `transformUnderscore` to `true` if you want to override the default behavior,\nwhich is to preserve underscores.\n\nAvailable case functions in `change-case-all` are `camelCase`, `capitalCase`, `constantCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`, `lowerCase`, `localeLowerCase`, `lowerCaseFirst`, `spongeCase`, `titleCase`, `upperCase`, `localeUpperCase` and `upperCaseFirst`\n[See more](https://github.com/btxtiger/change-case-all)\nDefault value: \"change-case-all#pascalCase\""
},
"typesPrefix": { "description": "Prefixes all the generated types.\nDefault value: \"\"", "type": "string" },
"typesSuffix": { "description": "Suffixes all the generated types.\nDefault value: \"\"", "type": "string" },
"skipTypename": {
"description": "Does not add `__typename` to the generated types, unless it was specified in the selection set.\nDefault value: \"false\"",
"type": "boolean"
},
"nonOptionalTypename": {
"description": "Automatically adds `__typename` field to the generated types, even when they are not specified\nin the selection set, and makes it non-optional\nDefault value: \"false\"",
"type": "boolean"
},
"useTypeImports": {
"type": "boolean",
"description": "Will use `import type {}` rather than `import {}` when importing only types. This gives\ncompatibility with TypeScript's \"importsNotUsedAsValues\": \"error\" option\nDefault value: \"false\""
},
"dedupeFragments": {
"description": "Removes fragment duplicates for reducing data transfer.\nIt is done by removing sub-fragments imports from fragment definition\nInstead - all of them are imported to the Operation node.\nDefault value: \"false\"",
"type": "boolean"
},
"inlineFragmentTypes": {
"description": "Whether fragment types should be inlined into other operations.\n\"inline\" is the default behavior and will perform deep inlining fragment types within operation type definitions.\n\"combine\" is the previous behavior that uses fragment type references without inlining the types (and might cause issues with deeply nested fragment that uses list types).\nDefault value: \"inline\"",
"type": "string"
},
"emitLegacyCommonJSImports": {
"description": "Emit legacy common js imports.\nDefault it will be `true` this way it ensure that generated code works with [non-compliant bundlers](https://github.com/dotansimha/graphql-code-generator/issues/8065).\nDefault value: \"true\"",
"type": "boolean"
}
}
},
"CSharpOperationsRawPluginConfig": {
"description": "This plugin generates C# `class` based on your GraphQL operations.",
"type": "object",
"properties": {
"namespaceName": {
"description": "Allow you to customize the namespace name.\nDefault value: \"GraphQLCodeGen\"",
"type": "string"
},
"namedClient": { "description": "Defined the global value of `namedClient`.", "type": "string" },
"querySuffix": {
"description": "Allows to define a custom suffix for query operations.\nDefault value: \"GQL\"",
"type": "string"
},
"mutationSuffix": {
"description": "Allows to define a custom suffix for mutation operations.\nDefault value: \"GQL\"",
"type": "string"
},
"subscriptionSuffix": {
"description": "Allows to define a custom suffix for Subscription operations.\nDefault value: \"GQL\"",
"type": "string"
},
"typesafeOperation": {
"description": "Allows to generate operation methods with class definitions for request/response parameters\nDefault value: \"false\"",
"type": "boolean"
},
"noGraphQLTag": {
"description": "Deprecated. Changes the documentMode to `documentNode`.\nDefault value: \"false\"",
"type": "boolean"
},
"gqlImport": {
"description": "Customize from which module will `gql` be imported from.\nThis is useful if you want to use modules other than `graphql-tag`, e.g. `graphql.macro`.\nDefault value: \"graphql-tag#gql\"",
"type": "string"
},
"documentNodeImport": {
"description": "Customize from which module will `DocumentNode` be imported from.\nThis is useful if you want to use modules other than `graphql`, e.g. `@graphql-typed-document-node`.\nDefault value: \"graphql#DocumentNode\"",
"type": "string"
},
"noExport": {
"description": "Set this configuration to `true` if you wish to tell codegen to generate code with no `export` identifier.\nDefault value: \"false\"",
"type": "boolean"
},
"dedupeOperationSuffix": {
"description": "Set this configuration to `true` if you wish to make sure to remove duplicate operation name suffix.\nDefault value: \"false\"",
"type": "boolean"
},
"omitOperationSuffix": {
"description": "Set this configuration to `true` if you wish to disable auto add suffix of operation name, like `Query`, `Mutation`, `Subscription`, `Fragment`.\nDefault value: \"false\"",
"type": "boolean"
},
"operationResultSuffix": {
"description": "Adds a suffix to generated operation result type names\nDefault value: \"\"",
"type": "string"
},
"documentVariablePrefix": {
"description": "Changes the GraphQL operations variables prefix.\nDefault value: \"\"",
"type": "string"
},
"documentVariableSuffix": {
"description": "Changes the GraphQL operations variables suffix.\nDefault value: \"Document\"",
"type": "string"
},
"fragmentVariablePrefix": {
"description": "Changes the GraphQL fragments variables prefix.\nDefault value: \"\"",
"type": "string"
},
"fragmentVariableSuffix": {
"description": "Changes the GraphQL fragments variables suffix.\nDefault value: \"FragmentDoc\"",
"type": "string"
},
"documentMode": {
"$ref": "#/definitions/DocumentMode_1",
"description": "Declares how DocumentNode are created:\n\n- `graphQLTag`: `graphql-tag` or other modules (check `gqlImport`) will be used to generate document nodes. If this is used, document nodes are generated on client side i.e. the module used to generate this will be shipped to the client\n- `documentNode`: document nodes will be generated as objects when we generate the templates.\n- `documentNodeImportFragments`: Similar to documentNode except it imports external fragments instead of embedding them.\n- `external`: document nodes are imported from an external file. To be used with `importDocumentNodeExternallyFrom`\n\nNote that some plugins (like `typescript-graphql-request`) also supports `string` for this parameter.\nDefault value: \"graphQLTag\""
},
"optimizeDocumentNode": {
"description": "If you are using `documentNode: documentMode | documentNodeImportFragments`, you can set this to `true` to apply document optimizations for your GraphQL document.\nThis will remove all \"loc\" and \"description\" fields from the compiled document, and will remove all empty arrays (such as `directives`, `arguments` and `variableDefinitions`).\nDefault value: \"true\"",
"type": "boolean"
},
"importOperationTypesFrom": {
"description": "This config is used internally by presets, but you can use it manually to tell codegen to prefix all base types that it's using.\nThis is useful if you wish to generate base types from `typescript-operations` plugin into a different file, and import it from there.\nDefault value: \"\"",
"type": "string"
},
"importDocumentNodeExternallyFrom": {
"description": "This config should be used if `documentMode` is `external`. This has 2 usage:\n\n- any string: This would be the path to import document nodes from. This can be used if we want to manually create the document nodes e.g. Use `graphql-tag` in a separate file and export the generated document\n- 'near-operation-file': This is a special mode that is intended to be used with `near-operation-file` preset to import document nodes from those files. If these files are `.graphql` files, we make use of webpack loader.\nDefault value: \"\"",
"type": "string"
},
"pureMagicComment": {
"description": "This config adds PURE magic comment to the static variables to enforce treeshaking for your bundler.\nDefault value: \"false\"",
"type": "boolean"
},
"experimentalFragmentVariables": {
"description": "If set to true, it will enable support for parsing variables on fragments.\nDefault value: \"false\"",
"type": "boolean"
},