Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node and Nodes - when is modern relay supposed to use these ? #1727

Closed
decebal opened this issue May 5, 2017 · 3 comments
Closed

Node and Nodes - when is modern relay supposed to use these ? #1727

decebal opened this issue May 5, 2017 · 3 comments

Comments

@decebal
Copy link

decebal commented May 5, 2017

I am struggling to gather information on how to make best use of these graphql entries.

Modified my TypeSystem to allow for these 2, but the app does not seem to use them at all, I guess my colleagues supposed classic relay will "automagically" use them. How is relay supposed to make use of these entries?

p.s. I encountered the relay directive for plurals, but not sure how it comes into picture here as it looks like modern relay is passing the directive in the query and my implementation of the TypeSystem does not allow for that at the moment, should it be supported on the Schema as well ?

@chollier
Copy link

chollier commented May 5, 2017

Relay Modern doesn't need node or nodes. Classic used them to "refetch" fields when it already had a node in the store but some fields where missing given the current query (query tracking / diffing)

@decebal decebal closed this as completed May 5, 2017
@decebal decebal changed the title Node and Nodes - when does modern relay is supposed to use these ? Node and Nodes - when is modern relay supposed to use these ? May 5, 2017
@insidewhy
Copy link

@chollier Does Relay Modern not do any query diffing at all? I have a bunch of stuff nested under my account data structure and requesting certain fields on that data structure is very expensive. I'd like to avoid having to re-request those fields when possible (they are always requested first thing when the app loads).

@wincent
Copy link
Contributor

wincent commented May 18, 2017

@ohjames: Correct, no query diffing at all. We're trading off magic for explicit control because it leads to a simpler (and usually much faster) result. If you want to manage an expensive subset of a query explicitly you would use an abstraction like a refetch container to fetch only the subset, at a specific time that is appropriate to your UX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants