Get rid of $input
edvinerikson opened this issue · comments
When using arguments in subscriptions you need to use $input
argument instead of passing arguments separate.
This behavior comes from mutations and I'm not sure what the tradeoffs are to get rid of it or if it is even possible without modifying the babel plugin.
How I know, it just Relay architectural solution. Graphql and babel-plugin do not have such restriction.
So if you ommit this wrap field, your subscriptions and relay mutations will have different symantics. So on server side we lost ability to reuse some resolve function from mutation. That just trade-off.
My opinion we should keep this field, while working under Relay, due relay arch design.
Thanks for the input on this @nodkz. Yeah I also think that it might be easier to keep the field as is. 👍
How do I get around this?
babel-relay-plugin won't transform my subscription. getting ..., but mutation fields must have exactly one argument named
input``
I just need to have an input{clientMutationId:ID!}
defined on my Subscription fields
@trbngr You will need to define $input
on your subscription and you should be fine.
I got it figured out. Great job on the abstraction, man!
Awesome @trbngr!