relay-tools / relay-hooks

Use Relay as React hooks
https://relay-tools.github.io/relay-hooks/docs/relay-hooks.html
MIT License
540 stars 56 forks source link

Fix: partial rendering #236

Closed Lalitha-Iyer closed 1 year ago

Lalitha-Iyer commented 1 year ago

I noticed partial data rendering was not working .While debugging I noticed we weren't passing the renderPolicy option to Fetchresolver.fetch method https://github.com/relay-tools/relay-hooks/blob/master/src/FetchResolver.ts#L120

Lalitha-Iyer commented 1 year ago

@morrys Let me know if I should create an issue first to describe the problem.

Lalitha-Iyer commented 1 year ago

Thanks for that great suggestion, I wasn't sure where to add this test case. I tested it locally and the new test passed. I also confirmed that the test failed on the "master" branch.

Lalitha-Iyer commented 1 year ago

Tangentially could you help me understand, why this option has an UNSTABLE prefix? I am considering using this in production code, is it safe to assume this option will not be deprecated in future versions?

morrys commented 1 year ago

relay-hooks is the open source version of react-relay with support for hooks that don't use Suspense.

The goal is to follow as much as possible the evolution of react-relay but above all of relay-runtime.

In this case, for relay that property is still considered unstable https://github.com/facebook/relay/blob/main/packages/react-relay/relay-hooks/useLazyLoadQuery.js#L40