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
{{ message }}
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
type QuickReply {
type: String
payload: QuickReplyPayload
}
type UserInConversation {
# other fields that I stripped out for clarity
userId: String
quickReply: QuickReply
}
type QuickReplyPayload {
messageId: String
conversationId: String
}
type Conversation {
_id: String
users: [UserInConversation]
createdAt: Int
}
The issue I'm having here is that when I call setConversation, if the input conversation contains users objects with different payload shapes, the cache update will fail silently (error is not cached) and value of conversation in local state is set to undefined !!!
For example, with these conversation inputs:
// In this case I think the payload data is not in the same shape ?
// However it works !
const conversation2 = {
_id: 'conversation2',
users: [
{
userId: 'userA',
quickReply: {
type: 'NONE',
payload: {
conversationId: 'test',
},
},
},
{
userId: 'userB',
quickReply: {
type: 'NONE',
payload: {
messageId: 'test',
},
},
},
],
};
... setConversationexecutes successfully. However, with these inputs: (notice the differences in the shapes of quickReply.payload)
... setConversation will failed to execute, with no errors thrown, also it set the conversation value in local state to undefined, which breaks a lot of logic in my app. My current work around for this is in the graphql server, I have a transformation function to always return the payload object in the shape of { messageId: '', conversationId: '' }.
Are there something wrong in my code or is this an issue with apollo link state ?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I'm using
apollo-link-state
to manage local state in myreact-native
app. Recently I face this frustrating issue:Here's my app's defaults state:
Here's the types definition:
The client mutation:
The mutation's resolver:
The client query to read
conversation
data from local state:The issue I'm having here is that when I call
setConversation
, if the inputconversation
containsusers
objects with differentpayload
shapes, the cache update will fail silently (error is not cached) and value ofconversation
in local state is set toundefined
!!!For example, with these
conversation
inputs:...
setConversation
executes successfully. However, with these inputs: (notice the differences in the shapes ofquickReply.payload
)...
setConversation
will failed to execute, with no errors thrown, also it set theconversation
value in local state toundefined
, which breaks a lot of logic in my app.My current work around for this is in the graphql server, I have a transformation function to always return the payload object in the shape of
{ messageId: '', conversationId: '' }
.Are there something wrong in my code or is this an issue with apollo link state ?
The text was updated successfully, but these errors were encountered: