Skip to content

Commit 7177ebb

Browse files
docs: mention the enums as type gql option
1 parent 5323ae6 commit 7177ebb

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

content/graphql/quick-start.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,33 @@ definitionsFactory.generate({
207207
});
208208
```
209209

210-
To automatically generate the additional `__typename` field for every object type, enable the `emitTypenameField` option.
210+
To automatically generate the additional `__typename` field for every object type, enable the `emitTypenameField` option:
211211

212212
```typescript
213213
definitionsFactory.generate({
214-
// ...,
214+
// ...
215215
emitTypenameField: true,
216216
});
217217
```
218218

219-
To generate resolvers (queries, mutations, subscriptions) as plain fields without arguments, enable the `skipResolverArgs` option.
219+
To generate resolvers (queries, mutations, subscriptions) as plain fields without arguments, enable the `skipResolverArgs` option:
220220

221221
```typescript
222222
definitionsFactory.generate({
223-
// ...,
223+
// ...
224224
skipResolverArgs: true,
225225
});
226226
```
227227

228+
To generate enums as TypeScript union types instead of regular TypeScript enums, set the `enumsAsTypes` option to `true`:
229+
230+
```typescript
231+
definitionsFactory.generate({
232+
// ...
233+
enumsAsTypes: true,
234+
});
235+
```
236+
228237
#### Apollo Sandbox
229238

230239
To use [Apollo Sandbox](https://www.apollographql.com/blog/announcement/platform/apollo-sandbox-an-open-graphql-ide-for-local-development/) instead of the `graphql-playground` as a GraphQL IDE for local development, use the following configuration:

0 commit comments

Comments
 (0)