-
Notifications
You must be signed in to change notification settings - Fork 722
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
Directives (i.e., @include) not working #117
Comments
Hmmm, it is a confirmed bug that Are you relying on the default value ( |
The fields I put I was primarily using the default values to check it was working. There was a point where I was passing in a value. If I passed in |
Yes, I think It's surprising that passing in |
I've been able to confirm there are bugs related to the way codegen handles |
Whoops! Just seeing your request. Would it still be helpful for you to describe the behavior in more detail, or do you think you have it all figured out at this point? |
@plflanagan: I'm in the process of rewriting the way we deal with conditions, so I don't necessarily need to know more about the current behavior. This should fix all of these issues, I'll keep you updated! |
@martijnwalraven Also, seeing issues when trying to return an optional object, ie:
Apollo is returning:
I can see graphql return something reasonable:
The Android code handles this correctly, fwiw. |
Initial poc on this:
in
Generated code would look like:
|
Something better would probably be this route:
|
@MaximusMcCann: Thanks for looking into this! I have an almost working implementation ready, but it turned out to be a little more complicated than I thought, and required a rewrite of the codegen compiler! I'm shooting for a beta after the weekend. One of the complications is that it isn't enough to know whether you can skip a field, because we also need to know when we can fulfill a query from the cache, and differentiate between missing values and
There are more complications, because query HeroAndFriendsNames($includeName: Boolean!, $includeFriendsName: Boolean!) {
hero {
id
name @include(if: $includeName)
friends {
id
}
friends @include(if: $includeFriendsName) {
name
}
... on Droid {
friends {
name
}
}
}
} Where you always fetch the names of friends of droids, but let that depend on the I believe the new compiler handles this correctly, but we'll have to do some careful testing because some of these situations get pretty hairy! |
@martijnwalraven excellent, cheers!! |
Also, believe this should go without saying, I would happily help test! ha. Just give me a heads up in this channel. Cheers! |
I just released Apollo iOS 0.7.0-alpha.1, which uses the updated codegen and should support |
@martijnwalraven Cheers!
|
@MaximusMcCann: Thanks for the report! This should be fixed in Apollo iOS 0.7.0-alpha.2. |
Cheers @martijnwalraven Next up, this query uses the
|
Thanks again for all the hard work!! |
@MaximusMcCann: I've made some changes in Apollo iOS 0.7.0-alpha.3 that will hopefully fix this. Let me know how it goes! |
@martijnwalraven Seeing duplicate generated code on alpha.3. We have a fragment on a fragment. Cheers!!
|
@MaximusMcCann: Thanks for the report, but I'm having some trouble reproducing this. Nested fragments doesn't seem to be the issue, and neither seems including the same fragment multiple times in different aliased subselections. Any chance you could reproduce this with the Star Wars schema or get a better sense of what causes it? |
@martijnwalraven Will try to have something to you by today, else it will be Thursday 👍 |
@martijnwalraven K, here's some more detail on our query.
Issues:
Cheers! Hope this helps. Side note, anyway to not have everthing dumped into a massive single file. Xcode gets real slow opening the file/linking to definitions. |
@MaximusMcCann: I'm sorry, but I still have trouble reproducing this. What is |
@MaximusMcCann: I managed to reproduce this with a query like: query HeroAndFriendsNamesWithFragmentTwice {
hero {
friends {
...CharacterName
}
... on Droid {
friends {
...CharacterName
}
}
}
} Not sure how that relates to the query above, but I fixed the issue in Apollo iOS 0.7.0-alpha.4. Could you check if that fixes your issue too? |
@martijnwalraven It compiles now, but still having issues when the
I believe the Cheers! |
@MaximusMcCann: I thought I changed the force cast. Is this using the latest v0.17.0-alpha.12? |
I see, I was on v0.7.0-alpha.8. Will try again this afternoon. cheers! |
@martijnwalraven The highest is see for alpha is 8, fyi. |
@MaximusMcCann: Oops sorry, I was confusing the Apollo iOS with the |
@martijnwalraven In this case the
|
@MaximusMcCann: I missed one of the cases when making those changes. Can you try again with v0.7.0-alpha.9? |
@martijnwalraven Cheers, alpha.9 doesn't have the |
@MaximusMcCann is this issue fixed? |
@fruitcoder close this, cheers |
Hello! I'm having some trouble using the |
I have a fragment
that is then queried by
but the name is always returned.
Some of the generated API code is
Any suggestions, or is this a confirmed bug currently?
The text was updated successfully, but these errors were encountered: