Skip to content

Commit

Permalink
feat(thegraph): auto-generate graphql types (Uniswap#1926)
Browse files Browse the repository at this point in the history
* auto-generate graphql types

* remove introspection

* generated .ts and add to prettierignore

* updated graph url
  • Loading branch information
Justin Domingue authored Jun 28, 2021
1 parent 6e995d6 commit 1667b56
Show file tree
Hide file tree
Showing 8 changed files with 5,814 additions and 103 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src/state/data/generated.ts
10 changes: 10 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
schema: 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3'
documents: 'src/**/!(*.d).{ts,tsx}'
generates:
./src/state/data/generated.ts:
plugins:
- typescript
- typescript-operations
- typescript-rtk-query:
importBaseApiFrom: './slice'
exportHooks: true
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"private": true,
"devDependencies": {
"@ethersproject/experimental": "^5.2.0",
"@graphql-codegen/cli": "1.21.5",
"@graphql-codegen/typescript": "1.22.3",
"@graphql-codegen/typescript-operations": "^1.18.2",
"@graphql-codegen/typescript-rtk-query": "^1.1.1",
"@lingui/cli": "^3.9.0",
"@lingui/loader": "^3.9.0",
"@lingui/macro": "^3.9.0",
Expand All @@ -15,6 +19,7 @@
"@reach/portal": "^0.10.3",
"@react-hook/window-scroll": "^1.3.0",
"@reduxjs/toolkit": "^1.6.0",
"@rtk-query/graphql-request-base-query": "^1.0.3",
"@typechain/ethers-v5": "^7.0.0",
"@types/jest": "^25.2.1",
"@types/lingui__core": "^2.7.1",
Expand Down Expand Up @@ -122,6 +127,7 @@
"i18n:extract": "lingui extract --locale en-US",
"i18n:compile": "lingui compile",
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run --record'",
"graphql:generate": "graphql-codegen --config codegen.yml",
"postinstall": "yarn compile-contract-types",
"start": "yarn compile-contract-types && react-scripts start",
"test": "react-scripts test --env=jsdom"
Expand Down
23 changes: 0 additions & 23 deletions src/state/data/common.ts

This file was deleted.

Loading

0 comments on commit 1667b56

Please sign in to comment.