Replies: 1 comment
-
I was able to debug this further and find out that it also happened when the request was not marked as stale. I believe this to be a bug: #1525 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a
ChatConversation
component with the following query (the@arguments
directive is part of graphql-ppx) using suspense.The
Conversation_View
fragment is preloaded with 1 message in a previous component. In this component it's requested with the last 20 messages.The
viewer
data is present in cache when this component is rendered.In a previous version of this component I did not have the second top level field with selection of
viewer { id }
. In that version of the component suspense kicks in as expected and when the component is rendered I have thechatConversation
data that I need to render the component.However, with the
viewer { id }
included the component doesn't suspend but instead immediately returns an object with:This is undesirable because the component can not render without
chatConversation
data (and this state would previously be considered an error).Is there a way to force the old behaviour where the component suspends until the request for
chatConversation
is completed?I feel like I can also not simply duplicate the loader screen from the parent component when
stale
is true since this is also the case when a previous page is being loaded (in which case we do want to show all the current chat data available).(The
chatConversation
field is nullable in the schema to handle the case where an incorrect or disallowed ID is provided. Perhaps that's a schema design mistake?)Edit
Could it be that this is actually a rescript-urql issue? I just realised that what I wrote down as value for
response
isn't entirely true.The response that I get is the
Data
variant andstale
is true. What I namedresponse
in my opening post is actuallydata
, but I'm not using that directly.Beta Was this translation helpful? Give feedback.
All reactions