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
When executing this query with data masking enabled, there is an error thrown:
Uncaught TypeError: Cannot read properties of undefined (reading 'id')
This happens when the item field returns a Track type. This is because the masking algorithm fails to check the inline fragment condition on the item before trying to add accessor warnings. In this case, the masking algorithm is trying to add warnings for the show field which should not happen because the fragment condition is unmatched.
We already handle this in the main part of the masking algorithm so we should be able to apply something similar here.
For now the workaround is to remove the mode: "migrate" argument from the @unmask directive to get this to work until we have a fix.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.
Issue Description
Take the following query from the Spotify Showcase:
When executing this query with data masking enabled, there is an error thrown:
This happens when the
item
field returns aTrack
type. This is because the masking algorithm fails to check the inline fragment condition on the item before trying to add accessor warnings. In this case, the masking algorithm is trying to add warnings for theshow
field which should not happen because the fragment condition is unmatched.We already handle this in the main part of the masking algorithm so we should be able to apply something similar here.
For now the workaround is to remove the
mode: "migrate"
argument from the@unmask
directive to get this to work until we have a fix.Link to Reproduction
https://github.com/apollographql/spotify-showcase/compare/jerel/masking-playground
Reproduction Steps
@apollo/client
version3.12.0-rc.0
The text was updated successfully, but these errors were encountered: