You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are there any reasons for generating getConnectionNodes helper for refetchable fragments only?
From my point of view, it would be nice to have it for both queries and regular fragments as well:
module SomeQuery = %relay(`
query SomeQuery {
whateverConnection @connection(key: "SomeConnection") {
edges {
node {
id
}
}
}
}
}
`)
let data = SomeQuery.use(~variables=(), ())
let connectionNodes = SomeQuery.getConnectionNodes(data.whateverConnection)
module SomeFragment = %relay(`
fragment SomeFragment_node on SomeNode {
whateverConnection @connection(key: "SomeConnection") {
edges {
node {
id
}
}
}
}
`)
let data = SomeFragment.use(nodeRef)
let connectionNodes = SomeFragment.getConnectionNodes(data.whateverConnection)
Right now, for queries case, I have to wrap everything in the query with refetchable fragment, and for the case of the fragment, I have to make the fragment be refetchable even if I don't need refetch for this fragment.
The text was updated successfully, but these errors were encountered:
There's no particular reason this couldn't be implemented on queries as well, if I remember correctly. Probably quite easy to implement.
One related feature I've been pondering for a long time is generating accessors. Imagine:
fragment SomeFragment_node on SomeNode {
some {
fieldGoes {
here @rescriptRelayAccessor
}
}
}
// Returns option of `here`
Fragment.get_some_fieldGoes_here(fragmentData)
I think this could be quite powerful, but would likely take some time to implement (and add quite a bit of complexity).
Hello there!
Are there any reasons for generating
getConnectionNodes
helper for refetchable fragments only?From my point of view, it would be nice to have it for both queries and regular fragments as well:
Right now, for queries case, I have to wrap everything in the query with refetchable fragment, and for the case of the fragment, I have to make the fragment be refetchable even if I don't need refetch for this fragment.
The text was updated successfully, but these errors were encountered: