logo

GraphQL API

The GraphQL API is useful for fetching workspace and user metadata including recordings, users that belong to a team, and comments added to a recording.
๐Ÿ’ก
The GraphQL API is not used for programmatically debugging a recording. If youโ€™d like to learn more about the Debugging Protocol, checkout the docs here.
javascript
try { const resp = await fetch("https://api.replay.io/v1/graphql", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ variables: {}, query: query, }), }); const json = await resp.json(); if (json.errors) { throw new Error(json.errors[0].message); } else if (!json.data) { throw new Error("No data was returned"); } return json; } catch (e) { console.log((e && e.message); return null; } }

Powered by Notaku
Share