-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
kind/enhancementNew feature or requestNew feature or requestpresetsRelated to Codegen presetsRelated to Codegen presets
Description
I want to generate typing declear once in single file and other files just import its type from it when i start working with react,typescript and graphql
Although near-operation-file-preset generates a file per each operation file,every file repeats typing declear. And import-types-preset helps import types from file but it can not generate files like near-operation-file-preset .
One more thing is that near-operation-file-preset contains both types and components ,while splited to single file may be better i think.
What I want may look like this:
graphql
|--test1.graphql // query and mutations
|--test1.generated.tsx // components and hooks without types
|--test2.graphql
|--test2.generated.tsx
|--types.ts // typesBut I find it's hard to work with both.
overwrite: true
schema: './schema.graphql'
documents: 'src/**/*.graphql'
generates:
src/graphql/types.tsx:
- typescript
src/graphql/:
preset:
# near-operation-file
import-types
presetConfig:
# extension: .generated.tsx
# baseTypesPath: types.ts
typesPath: types.ts
plugins:
- time:
format: DD.MM.YY
message: 'The file generated in: '
- typescript
- typescript-operations
- typescript-react-apollo
config:
withHOC: true
withHooks: true
skipTypename: trueDoes anyone can help me ?
Thanks a lot!
ktmud, capaj, nairmanu and agboolaidris
Metadata
Metadata
Assignees
Labels
kind/enhancementNew feature or requestNew feature or requestpresetsRelated to Codegen presetsRelated to Codegen presets