Skip to content

Commit e4d0f52

Browse files
committed
feat(graphql): enchance codegen (plugins)
https://github.com/martis-git/learn-frontend/issues/279
1 parent d012f7f commit e4d0f52

File tree

4 files changed

+188
-214
lines changed

4 files changed

+188
-214
lines changed

examples/graphql/codegen.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ documents: 'src/**/*.gql'
44
generates:
55
src/gen/graphql.tsx:
66
config:
7-
noNamespaces: true
8-
withComponent: false
9-
withHOC: false
7+
# FIXME: SPECIFY (noNamespaces: false)
8+
# TODO: avoidTypeName
9+
skipTypename: true
1010
withHooks: true
11+
immutableTypes: true
12+
avoidOptionals: true
13+
# Чтобы работал intelissense
14+
preResolveTypes: true
15+
# onlyOperationTypes: true
1116
plugins:
1217
- 'typescript'
1318
- 'typescript-operations'

examples/graphql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"build": "react-scripts build",
3232
"test": "react-scripts test",
3333
"eject": "react-scripts eject",
34-
"gen": "graphql-codegen"
34+
"api:gen": "graphql-codegen"
3535
},
3636
"eslintConfig": {
3737
"extends": "react-app"

0 commit comments

Comments
 (0)