Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link app to datasources (read + write) #33

Merged
merged 6 commits into from
Jan 15, 2024
Merged

Conversation

bowd
Copy link
Contributor

@bowd bowd commented Jan 14, 2024

⚠️ This branch is based off #31 and #32 as well, so it should be reviewed after those two are merged

Overview

This PR introduces a base-line for connecting the UI to two data sources:

  1. [read] from a graphql server hosted by the thegraph.com, currently in development mode.
  2. [rand/write] from a blockchain node via wagmi.

The GraphQL server

Most of the setup and files live in the app/graphql folder. There's also a generated folder there where code gets automatically generated if we change queries. But you must run the codegen tool:

> pnpm graphql-codegen --watch

You don't need to run it if you're not changing the graphql queries.

For a preview on how that's implemented follow the proposals list example, and read the README in app/graphql.

The on-chain data and making transactions

While starting to wire this up I realised that rainbowkit is about to launch 2.0.0 and there's a 2.0.0-beta.1 version out there, which updates to the 2.x versions of viem and wagmi. If we develop this app on 1.x we will be behind and it will probably a be a pain to migrate so I update rainbowkit to 2.0.0 and in the process got rid of the @celo/rainbowkit-celo dependency (see: celo-org/rainbowkit-celo#84), simplifying the setup a bit.

I've then wired up the create proposal form in a quite hacky way but just to get it working. There's still a bunch to do:

  • transaction loading
  • transaction confirmation
  • show pending transactions

Notes

I think there's no use for the api routes that we currently have, and we will also potentially deprecate some of the stores. I'm working now on a way to get balances and other on-chain data easily.

Copy link

vercel bot commented Jan 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
governance-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 11:30am

@tplocic20 tplocic20 merged commit 382aba2 into main Jan 15, 2024
3 checks passed
@tplocic20 tplocic20 deleted the feat/connect-graphql branch January 15, 2024 12:37
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