Skip to content

Commit ff116cd

Browse files
committed
[graphql-codegen] move go fmt hook into outputed file scope
1 parent e231c89 commit ff116cd

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ yarn install -D graphql-codegen-golang
1919
## Usage: `codegen.yaml`
2020

2121
```yaml
22-
hooks:
23-
afterAllFileWrite: go fmt
24-
2522
schema: graphql/schema.graphql
2623
documents: graphql/documents/**/*.graphql
2724
generates:
28-
gen/output.go:
25+
pkg/graphql/graphql.go:
26+
hooks:
27+
afterOneFileWrite: go fmt
2928
plugins:
30-
- graphql-codegen-golang
29+
- graphql-codegen-golang:
30+
packageName: graphql # default
3131
```
3232
3333
## Configuration

graphql.config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ documents:
44
- main.go
55
extensions:
66
codegen:
7-
hooks:
8-
afterAllFileWrite: go fmt
97
generates:
108
pkg/graphql/graphql.go:
9+
hooks:
10+
afterOneFileWrite: go fmt
1111
plugins:
12-
- dist/index.js
12+
- dist/index.js:
13+
# packageName: graphql # default

0 commit comments

Comments
 (0)