Guides / Subscriptions

Subscriptions

A practical guide to subscriptions with Relay Docs. Work through the example, then adapt it to your project.

✦   Before you begin, complete the quickstart and keep your test credentials nearby.

Overview

Subscriptions helps you connect the pieces of your workflow. Start small, check the result, and only then move this pattern into production.

A working example

Example
relay.subscribe("updates", handler)

Before you move on

01

Check your inputs

Use the test environment and verify the request data matches your intended schema.

02

Inspect the response

Confirm the returned status and identifiers before using the result elsewhere.

03

Handle the unexpected

Account for incomplete data, retries and useful feedback to the person using your app.