Skip to content

Commit

Permalink
Update example "with-typescript-graphql" (#10637)
Browse files Browse the repository at this point in the history
* add peerDeps of graphql-let

* ncu -u && typesync

* Use resolver types for resolver implementation
  • Loading branch information
piglovesyou committed Feb 25, 2020
1 parent c57cdbb commit ccb42b0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 2 additions & 0 deletions examples/with-typescript-graphql/.gitignore
@@ -1 +1,3 @@
.next
node_modules
__generated__
1 change: 1 addition & 0 deletions examples/with-typescript-graphql/.graphql-let.yml
Expand Up @@ -5,3 +5,4 @@ plugins:
- typescript
- typescript-operations
- typescript-react-apollo
respectGitIgnore: true
12 changes: 5 additions & 7 deletions examples/with-typescript-graphql/lib/resolvers.ts
@@ -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 }
20 changes: 12 additions & 8 deletions examples/with-typescript-graphql/package.json
Expand Up @@ -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"
}
}

0 comments on commit ccb42b0

Please sign in to comment.