Skip to content

Commit 6731256

Browse files
committed
fixed README for typesPrefix
1 parent 207665f commit 6731256

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,33 @@ import { GeneratedInput } from './graphql'
8080
/* generates validation schema here */
8181
```
8282

83+
### `typesPrefix`
84+
85+
type: `string` default: (empty)
86+
87+
Prefixes all import types from generated typescript type.
88+
89+
```yml
90+
generates:
91+
path/to/graphql.ts:
92+
plugins:
93+
- typescript
94+
path/to/validation.ts:
95+
plugins:
96+
- typescript-validation-schema
97+
config:
98+
typesPrefix: I
99+
importFrom: ./graphql # path for generated ts code
100+
```
101+
102+
Then the generator generates code with import statement like below.
103+
104+
```ts
105+
import { IGeneratedInput } from './graphql'
106+
107+
/* generates validation schema here */
108+
```
109+
83110
### `enumsAsTypes`
84111

85112
type: `boolean` default: `false`

0 commit comments

Comments
 (0)