⚠️ 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:
[read] from a graphql server hosted by the thegraph.com, currently in development mode.
[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: https://github.com/celo-org/rainbowkit-celo/issues/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.
Overview
This PR introduces a base-line for connecting the UI to two data sources:
The GraphQL server
Most of the setup and files live in the
app/graphql
folder. There's also agenerated
folder there where code gets automatically generated if we change queries. But you must run the codegen tool: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 the2.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 to2.0.0
and in the process got rid of the@celo/rainbowkit-celo
dependency (see: https://github.com/celo-org/rainbowkit-celo/issues/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:
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.