reym
Streams

GraphQL API

Documentation of the GraphQL API of the Streams service

The GraphQL API of the Streams service is available at /management/graphql An API sandbox is available at /management/graphql/sandbox.

Sandbox

Use the sandbox to get an overview of the API that your schema configuration generates.

Authenticate to the API by sending a valid JWT within the Authorization header as a bearer token: Authorization: Bearer replace.by.your.jwt

Subscriptions

Subscriptions to events in a topic require a little bit of guidance:

You can use the topics subscription to subscribe to events of a topic. The first thing you will receive from that subscription is data of the type TopicSubscriptionDataSubscribed. That data contains your subscriberId and optionally an error. If the error is not null, the subscription was not established successfully and you should not continue to use the subscription. If the error is null, you can continue to use the subscription and will receive data of the type TopicSubscriptionDataEvent for each event that occurs in the topic. In case you get data of the type TopicSubscriptionDataPanic, the subscription has encountered an error and is no longer usable. You should close the subscription in that case.

Subscribe to a topic

After receiving data of the type TopicSubscriptionDataEvent you can process the event. Use the eventHandled mutation to acknowledge that you have processed the event. This includes the case when the processing resulted in an error. Pass the error message along with the mutation in that case. Streams will then try try to deliver the event again to another subscriber. Within a topic subscription you receive events sequentially. You wont receive the next event before you processed the current one.