Link app to datasources (read + write) #33
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: 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:
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.