You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-26Lines changed: 16 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,10 @@ types to make it type-safed when developing GraphQL server (mainly resolvers)
9
9
10
10
## Features
11
11
12
-
### Generate Typescript from Schema Definition
13
-
### Support [Typescript string enum](https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#typescript-25) with fallback to string union (fallback not tested yet)
14
-
### Convert GraphQL description into JSDoc
15
-
### Also add deprecated field and reason into JSDoc
12
+
### Generate Typescript from Schema Definition (1-1 mapping from GQL type to TypeScript)
13
+
### Convert GraphQL description into JSDoc, include deprecated directive
16
14
### [Generate TypeScripts to support writing resolvers](#type-resolvers)
15
+
### [VSCode extension](#https://github.com/liyikun/vscode-graphql-schema-typescript) (credit to [@liyikun](https://github.com/liyikun))
17
16
18
17
## Usage
19
18
@@ -52,7 +51,7 @@ The file generated will have some types that can make it type-safed when writing
52
51
* Parent type and resolve result is default to `any`, but could be overwritten in your code
* Strategy for guessing TParent & TResult in resolvers
139
-
* v1.2.1:
140
-
* Added strict nulls option for compatibility with apollo-codegen
141
-
* v1.2.0:
142
-
* Field resolvers under subscriptions are being generated with resolve and subscribe method
143
-
* v1.1.0:
144
-
* Add CLIs support
145
-
* v1.0.6:
146
-
* Generate TypeScript for resolvers. See [Type Resolvers](#type-resolvers)
147
-
* v1.0.4:
148
-
* If types is generated under global scope, use string union instead of string enum
149
-
150
-
* v1.0.2:
151
-
* Change default prefix from `GQL_` to `GQL`
152
-
* Add config options: allow to generate types under a global or namespace declaration
131
+
```javascript
132
+
// in v1.12.11, asyncResult also accept string value 'always',
133
+
// which will make returns value of resolve functions to be `Promise<TResult>`,
134
+
// due to an issue with VSCode that not showing auto completion when returns is a mix of `T | Promise<T>` (see [#17](https://github.com/dangcuuson/graphql-schema-typescript/issues/17))
0 commit comments