We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I already tried everything on many issues from: #6340
This is happening in the latest: "@apollo/client": "3.1.3",
const messagesQuery = useQuery<MSSGetMessages, MSSGetMessagesVariables>(MSS_GET_MESSAGES, { notifyOnNetworkStatusChange: true, fetchPolicy: 'network-only', variables: { profileId: authState.profileId! }, }); React.useEffect(() => { messagesQuery.subscribeToMore<MSSMessagesSubscription>({ document: MSS_MESSAGES_SUBSCRIPTION, updateQuery: (prev, { subscriptionData }) => { if (!subscriptionData.data) return prev; const newMessage = subscriptionData.data.onCreateDateChatMessage; const chats = new List(prev.dateChats?.items?.slice()); const targetChatIndex = prev.dateChats?.items?.findIndex( (x) => x?.id === newMessage?.dateChatId )!; const targetChat = chats.ElementAt(targetChatIndex); chats.RemoveAt(targetChatIndex); if (targetChat) { const newTargetChat: MSSGetMessages_dateChats_items = { ...targetChat, messages: { ...targetChat.messages, items: [ ...targetChat.messages?.items!, { id: newMessage?.id!, message: newMessage?.message!, }, ], }, }; return { ...prev, dateChats: { ...prev.dateChats, items: [newTargetChat, ...chats.ToArray()], }, }; } else { // Chat does not exist reload. return { dateChats: null }; } }, }); }, []);
If I comment out
{ id: newMessage?.id!, message: newMessage?.message!, },
The query does not refetch again since is the same data.
So the real question is:
How can I modify that object in order to not trigger a refetch in that query.
The text was updated successfully, but these errors were encountered:
Removing notifyOnNetworkStatusChange: true, fetchPolicy: 'network-only',
Solves my issue
Sorry, something went wrong.
No branches or pull requests
I already tried everything on many issues from:
#6340
This is happening in the latest: "@apollo/client": "3.1.3",
If I comment out
The query does not refetch again since is the same data.
So the real question is:
How can I modify that object in order to not trigger a refetch in that query.
The text was updated successfully, but these errors were encountered: