Open dustinfarris opened 7 years ago
when using mutations on live data, i have that mutation return a GraphQLBoolean or similar. The reason why is because if it's live, then you aren't going to respond directly, rather the response is going to come from your pubsub. otherwise, you'd be getting 2 results (1 for the requesting client, and another being the requesting entity is subscribed to that pubsub channel)
@mattkrick thanks, yeah i figured that much out. i do think there should be an error from cashay for such a mutation that selects live fields—but feel free to close if that's more of a roadmap thing
yeah, v2 i'm just gonna scrap the mutation-writing heuristic, which will solve this. it was cute, but annoying, specifically for this bug that lies in the graphql package (i still think calling a mutation w/o wanting anything back is useful & the fact that graphql disallows that is silly IMO).
If you have a mutation that returns an object (not a scalar), e.g.
cashay will build the mutation to select fields for that type to fulfill any active queries.
but cashay seems to ignore
@live
directives (and possibly@cached
as well?)e.g. if you have a query
when you run the mutation
cashay sends this to the server:
which causes graphql to throw:
Unknown directive "live".