Closed asaadreh-meister closed 1 month ago
@asaadreh-meister To get the variables properly mapped onto your selection set you should be able to use the from(_ mock: withVariables:) method on your selection set and pass in the variables being used for your include/skip conditions.
A very basic usage of this is shown in this test.
Going to go ahead and close this since the above comment should resolve the issue, feel free to comment if this is still an issue and we can reopen and investigate.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
Summary
I use several
include
s andskip
s in my queries. They are working fine in the app. However, while writing tests for the code, I noticed that any field or fragment marked withinclude
is always omitted. I tested it with skip and it was the same. If i leave out the include, the correct object is returned.Is this issue known? Is there a workaround? (without having to remove the directives)
Version
1.15.1
Steps to reproduce the behavior
My query looks like this:
A very basic test is:
Any field or fragment that has
include
in it is returned as nil in the mocks. In the actual app it works fine.Logs
No response
Anything else?
No response