Use Relay Modern for data-fetching with Hasura
react-relay
for data-fetching with the experimental flag (hooks ftw).The base of this project is that Relay asks for a server that provides a mechanism for refetching an object, i.e., a global id. Hasura can’t garantee that you’ll have unique global ids, so you need to implement the getDataID
when creating your Relay environment. In this case, I made the global id an string with <typename>:<id>
encoded as base64 (the standard of graphql-relay
).