-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Support for @optional
and sibling fields on type coercion
#268
Comments
Unfortunately, I don't have a concrete timeline to offer. Appropriately prioritizing between the various ways to expand query functionality (e.g. this, #83, more There are several workarounds available in the meantime, and which is most appropriate is a function of your specific queries and use case:
Also, as you've found, the spec outlines the desired semantics but isn't fully implemented. We need to document this fact better, and I'd welcome PRs to that effect. |
@optional
, cannot have sibling fields)@optional
and sibling fields on type coercion
Very reasonable, thanks for the suggested workarounds! This isn't a show-stopper for me, but it is a nice functionality, at least for me. #83 also looks very desirable for my purposes, so I completely understand that your time is limited (unfortunately, so is mine) |
Related to this (but perhaps not?), adding I mean someUnrelatedData @output
someField @optional {
... on somethingElse {
id @output
}
} produces an empty list instead of the unrelated data like I expect |
Yes, I suspect this is indeed related to how In other words, the semantics don't allow "pretending the edge didn't exist" if an optional edge did exist but failed to satisfy a subsequent filter or type coercion. That's a semantically different operation that's much broader than the edge, and can be partially emulated with a |
I have some issues with some of my queries failing because their type coercion cannot be marked as
@optional
, and also because they cannot have sibling fields (both are defined in the specs).The current behavior seems to match that of GraphQL compiler, but is there any plans to update this behaviour?
Currently I see no other option than to have multiple queries to not fail based on a coercion not working, but perhaps my queries are wrong?
The text was updated successfully, but these errors were encountered: