Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renanmav/hasura-relay-example
Use Relay Modern for data-fetching with Hasura
https://github.com/renanmav/hasura-relay-example
example graphql hasura relay
Last synced: 24 days ago
JSON representation
Use Relay Modern for data-fetching with Hasura
- Host: GitHub
- URL: https://github.com/renanmav/hasura-relay-example
- Owner: renanmav
- Created: 2020-03-03T21:19:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-08T23:13:16.000Z (over 4 years ago)
- Last Synced: 2024-10-12T19:32:51.619Z (29 days ago)
- Topics: example, graphql, hasura, relay
- Language: TypeScript
- Homepage: https://hasura-relay-example.now.sh/
- Size: 217 KB
- Stars: 25
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - hasura-relay-example - fetching with Hasura | renanmav | 25 | (TypeScript)
README
# hasura-relay-example
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
- It uses [`react-relay`](https://github.com/facebook/relay/tree/master/packages/react-relay) for data-fetching with the experimental flag (hooks ftw).
- The Hasura app was deployed following this [starter guide](https://hasura.io/docs/1.0/graphql/manual/getting-started/index.html).The base of this project is that Relay asks for a server that provides a [mechanism for refetching an object](https://github.com/graphql/graphql-relay-js), i.e., a global id. Hasura can’t garantee that you’ll have unique global ids, so you need to implement the [`getDataID`](https://github.com/renanmav/hasura-relay-example/blob/master/src/environment.ts#L40-L42) when creating your Relay environment. In this case, I made the global id an string with `:` encoded as base64 (the standard of [`graphql-relay`](https://github.com/graphql/graphql-relay-js)).