Unverified Commit ccb42b0e authored by Soichi Takamura's avatar Soichi Takamura Committed by GitHub

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

* add peerDeps of graphql-let

* ncu -u && typesync

* Use resolver types for resolver implementation
parent c57cdbb3
.next
node_modules
__generated__ __generated__
...@@ -5,3 +5,4 @@ plugins: ...@@ -5,3 +5,4 @@ plugins:
- typescript - typescript
- typescript-operations - typescript-operations
- typescript-react-apollo - typescript-react-apollo
respectGitIgnore: true
import { IResolvers } from 'apollo-server-micro' import { QueryResolvers } from './type-defs.graphqls'
const resolvers: IResolvers = { const Query: Required<QueryResolvers> = {
Query: { viewer(_parent, _args, _context, _info) {
viewer(_parent, _args, _context, _info) { return { id: String(1), name: 'John Smith', status: 'cached' }
return { id: 1, name: 'John Smith', status: 'cached' }
},
}, },
} }
export default resolvers export default { Query }
...@@ -18,20 +18,24 @@ ...@@ -18,20 +18,24 @@
"apollo-client": "2.6.8", "apollo-client": "2.6.8",
"apollo-link-http": "1.5.16", "apollo-link-http": "1.5.16",
"apollo-link-schema": "1.2.4", "apollo-link-schema": "1.2.4",
"apollo-server-micro": "2.9.14", "apollo-server-micro": "2.10.1",
"apollo-utilities": "^1.3.3", "apollo-utilities": "^1.3.3",
"graphql": "^14.5.8", "graphql": "^14.6.0",
"graphql-tag": "^2.10.1", "graphql-tag": "^2.10.3",
"next": "latest", "next": "latest",
"react": "^16.12.0", "react": "^16.12.0",
"react-dom": "^16.12.0" "react-dom": "^16.12.0"
}, },
"devDependencies": { "devDependencies": {
"@graphql-codegen/typescript": "^1.9.1", "@graphql-codegen/cli": "1.12.2",
"@graphql-codegen/typescript-operations": "^1.9.1", "@graphql-codegen/plugin-helpers": "1.12.2",
"@graphql-codegen/typescript-react-apollo": "^1.9.1", "@graphql-codegen/typescript": "^1.12.2",
"@types/react": "^16.9.17", "@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", "graphql-let": "0.x",
"typescript": "^3.7.4" "typescript": "^3.8.2"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment