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
Got an error when subscribing to new links.
updateQuery: (prev, { subscriptionData }) => { if (!subscriptionData.data) return prev; const newLink = subscriptionData.data.newLink; **const exists = prev.feed.links.find((link) => link.id === newLink.id);** if (exists) return prev; return Object.assign({}, prev, { feed: [newLink, ...prev.feed.links], count: prev.feed.links.length + 1, __typename: prev.feed.__typename, }); }, });
when the "linkList" page loads, the value of newLink is null. So rather than proceeding further, we return the prev/current list.
updateQuery: (prev, { subscriptionData }) => { if (!subscriptionData.data) return prev; const newLink = subscriptionData.data.newLink; **if (!newLink) return prev;** const exists = prev.feed.links.find((link) => link.id === newLink.id); if (exists) return prev; return Object.assign({}, prev, { feed: [newLink, ...prev.feed.links], count: prev.feed.links.length + 1, __typename: prev.feed.__typename, }); }, });
The text was updated successfully, but these errors were encountered:
I also found the updateQuery function is called 2 times when someone posts a link. First time with the prev data and second without prev data.
updateQuery
Sorry, something went wrong.
No branches or pull requests
Got an error when subscribing to new links.
when the "linkList" page loads, the value of newLink is null. So rather than proceeding further, we return the prev/current list.
The text was updated successfully, but these errors were encountered: