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

Highlight Issue: Todo example with Relay v15.0.0 and @required field #251

Closed eduardolundgren closed 9 months ago

eduardolundgren commented 10 months ago

Changes

Question

In addition to the above observations regarding the @required field with Relay v15.0.0, I'd like to ask if there are any plans or intentions to fully support Relay v15.0.0 in the near future? It would be helpful to know for those of us who are considering upgrading or building upon this version. Thank you.

relay-hooks relay
morrys commented 10 months ago

Hi @eduardolundgren, thanks for the PR 👍 I made some changes and drafted the PR.

As far as relay v15 support is concerned, the idea is to support it entirely with particular interest in features that are both concurrent and non-concurrent.

Being a project that I carry out in my free time, some of them may involuntarily escape me but I am always available to integrate them or evaluate PRs that do so.

eduardolundgren commented 10 months ago

All changes look good to me.

Given these @required enhancements, would it be possible to kindly consider releasing a new version with these changes?

Thanks for your hard work on this project.

morrys commented 9 months ago

Hi @eduardolundgren, this PR has been released https://github.com/relay-tools/relay-hooks/releases/tag/v8.0.1

let me know if there are any problems :)

eduardolundgren commented 9 months ago

Thank you, @morrys. I will test version 8.0.1 in the coming days and inform you of any issues.

eduardolundgren commented 9 months ago

Hi @morrys, we tested it on the product codebase, and it works as expected. We're investigating a use case that might be atypical: we want to invalidate the cache for the query that resulted in an exception from @required. I've noticed that the error thrown originates from inside a RelayObservable and doesn't bubble up. We'll continue our investigation, but I wanted to share this with you in case you have any insights on its feasibility. Having access to the component or query it came from, this could be achieved either by interacting with the relay store or by accessing the component instance and incrementing the fetchKey. Thanks.

morrys commented 9 months ago

Hi @eduardolundgren, have you tried opening an issue in relay? This seems like a problem that could be fixed in relay-runtime

eduardolundgren commented 9 months ago

@morrys I've noticed that the exception isn't thrown when @required is inside a fragment. Is this expected?

morrys commented 8 months ago

@eduardolundgren In the example project in this PR the error is thrown by the fragment.