-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
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
_asInlineFragment
always evaluating to true
without direct selections
#3309
Comments
I believe this is correct behaviour.
Even though your operation may not have any direct selections for the fragment Apollo iOS automatically inserts the
No, unfortunately this is not optional behaviour. |
Thanks for the detailed reply @calvincestari - really appreciate it! |
@spencer-coterie - I've recently made a fix regarding |
Question
After upgrading to the latest version,
1.7.1
, I'm seeing a change in the behavior which I believe to be caused by the introduction ofCompositeInlineFragment
. With this change, the_asInlineFragment()
is evaluating totrue
for all types which have no direct selections of its own.We commonly employ a pattern where the GQL union is compromised of multiple types, and it's common for at least 1 type to have no direct selections.
We previously used the
asMyCustomType
variable as a way to identify the type, but this appears to be falsely evaluating totrue
, which is a change in behavior. I believe this change was first introduced in version1.1
. We previously pinned the version to1.0.7
and were not seeing this issue.Workaround
For the time being, we have a workaround, and that's to perform a direct comparison with
__typename
.Questions
The text was updated successfully, but these errors were encountered: