{"repo":"zth/rescript-relay","free":true,"listed":false,"github":"https://github.com/zth/rescript-relay","clone":"git clone https://github.com/zth/rescript-relay.git","description":"Use Relay with ReScript.","language":"ReScript","stars":345,"topics":["reasonml","reason-react","relay-modern","relay","react","graphql","rescript","rescript-react"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"rescript-relay Use Relay with ReScript. Join our Discord Getting started Are you using version = 0.13.0 and ReScript syntax with VSCode? Make sure you install our dedicated VSCode extension. Note: It only works with ReScript syntax. Check out the documentation. Also, check out the changelog - things will continue to change between versions (including breaking changes, although we'll try and keep them to a minimum) as we iterate and reach a stable version. What it looks like Your components define what data they need through %relay() . Fragments can include other fragments. This allows you to break your UI into encapsulated components defining their own data demands. Hooks to use your fragments are autogenerated for you. The hook needs a fragment reference from the GraphQL object where it was spread. Any object with one or more fragments spread on it will have a fragmentRefs prop on it, someObj.fragmentRefs . Pass that to the fragment hook. Avatar user is spread right on the fragment, so we pass userData.fragmentRefs to the component since we know it'll contain the fragment ref for Avatar user that needs. The component then uses that to get its data. Finally, you make a query using %relay() and include the fragments needed to render the entire tree of components. Note about versioning RescriptRelay has moved through a few major lines with different ReScript baselines. Use the compatibility guide below to pick the right versions: Compatibility RescriptRelay Required ReScript --","default_branch":null,"files":null,"tree":[],"storefront":"/r/zth","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zth/rescript-relay/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}