Update example "with-typescript-graphql" (#10637)

* add peerDeps of graphql-let

* ncu -u && typesync

* Use resolver types for resolver implementation
This commit is contained in:
Soichi Takamura 2020-02-25 15:44:09 +09:00 committed by GitHub
parent c57cdbb31d
commit ccb42b0ed5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 15 deletions

View file

@ -1 +1,3 @@
.next
node_modules
__generated__

View file

@ -5,3 +5,4 @@ plugins:
- typescript
- typescript-operations
- typescript-react-apollo
respectGitIgnore: true

View file

@ -1,11 +1,9 @@
import { IResolvers } from 'apollo-server-micro'
import { QueryResolvers } from './type-defs.graphqls'
const resolvers: IResolvers = {
Query: {
viewer(_parent, _args, _context, _info) {
return { id: 1, name: 'John Smith', status: 'cached' }
},
const Query: Required<QueryResolvers> = {
viewer(_parent, _args, _context, _info) {
return { id: String(1), name: 'John Smith', status: 'cached' }
},
}
export default resolvers
export default { Query }

View file

@ -18,20 +18,24 @@
"apollo-client": "2.6.8",
"apollo-link-http": "1.5.16",
"apollo-link-schema": "1.2.4",
"apollo-server-micro": "2.9.14",
"apollo-server-micro": "2.10.1",
"apollo-utilities": "^1.3.3",
"graphql": "^14.5.8",
"graphql-tag": "^2.10.1",
"graphql": "^14.6.0",
"graphql-tag": "^2.10.3",
"next": "latest",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
"devDependencies": {
"@graphql-codegen/typescript": "^1.9.1",
"@graphql-codegen/typescript-operations": "^1.9.1",
"@graphql-codegen/typescript-react-apollo": "^1.9.1",
"@types/react": "^16.9.17",
"@graphql-codegen/cli": "1.12.2",
"@graphql-codegen/plugin-helpers": "1.12.2",
"@graphql-codegen/typescript": "^1.12.2",
"@graphql-codegen/typescript-operations": "^1.12.2",
"@graphql-codegen/typescript-react-apollo": "^1.12.2",
"@graphql-codegen/typescript-resolvers": "1.12.2",
"@types/react": "^16.9.22",
"@types/react-dom": "^16.9.5",
"graphql-let": "0.x",
"typescript": "^3.7.4"
"typescript": "^3.8.2"
}
}