everest
everest copied to clipboard
Migrate Everest to use `graph-client` library
We recently introduced https://github.com/graphprotocol/graph-client as a wrapper for making it easier to dapps to write JS/TS (browser/Node) apps.
This is an initial PR for using this client in Everest app, with minimal changes.
Changes includes:
- Added
graph-clientand generated The Graph Client library (nothing too sophisticated at the moment, later we can leverage all the cool features there). - Moved GraphQL queries to be in
.graphqlfiles and updated the code accordingly (this way the graph client validates the operations at build time, and we get complete TypeScript support out of the box) - Adjust Gatsby configuration to support MJS and TS.
- Replace
cross-fetchwithcross-undici-fetchfor better native support (both Gatsby's Node env and browser env)
I recommend doing follow-up PRs later, to improve:
- Migrate to TS (graph-client comes with a built-in support for TypedDocumentNode, so we can leverage type inference)
- Upgrade Gatsby to latest (at the moment, I did some workarounds in Webpack config to make it work properly)
- Upgrade Apollo-Client to v3 (graph-client comes with a built-in support for it)
- Drop
@graphprotocol/mutationsand use built-in mutations support fromgraph-client - Upgrade to latest Node (16/17)
Oops! We have a different version of this repo that's been migrated to Next. Hopefully will be easy to port over. Let's sync up offline
Oops! We have a different version of this repo that's been migrated to Next. Hopefully will be easy to port over. Let's sync up offline
Sure no problem, it would be easier :)