Submit the Subscriptions
Learn how to submit subscriptions in GraphQL.
We'll cover the following...
Basic subscription
Now that we can create orders, we’re at the perfect spot to introduce the first basic subscription. This subscription will support pushing these orders as they’re created out to subscribed clients. We’ll first need to define a subscription field in our schema, and then we’ll also need a way to trigger this subscription when the :place_order
mutation runs:
Press + to interact
subscription dofield :new_order, :order doconfig fn _args, _info ->{:ok, topic: "*"}endendend
For the most part, this is an ordinary-looking field. We’ve got another top-level object subscription to house our subscription fields, and then the :new_order
, which returns the :order
object we’re already ...