- Create your tables in supabase.
- Link the related fields.
- Create a public user table and update the handle_new_user() function.
- Go to the SQL console and run:
select graphql.rebuild_schema();
- Go to Apollo Studio and create a development Graph.
- Set the
apiKey:
andContent-Type:
headers. - The Schema will load automatically.
- Copy past the queries you need into your project 🍾
The <ApolloProvider>
takes onw client and makes it available when calling the hooks.
To use a second endpoint, define a separate client and pass it as option argument to the hooks. See [docs]{https://www.apollographql.com/docs/react/api/react/hooks/#usequery}
We want a like or dislike to be unique. So with this little hack, the user can only give one like per NFT:
alter table "Like"
add constraint uq_Person unique(user_id, nft_id);
🤓