Skip to content

Conversation

@dotansimha
Copy link

@dotansimha dotansimha commented Mar 23, 2022

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-client and 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 .graphql files 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-fetch with cross-undici-fetch for 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/mutations and use built-in mutations support from graph-client
  • Upgrade to latest Node (16/17)

@yanivtal
Copy link

yanivtal commented Mar 23, 2022

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

@dotansimha
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants