Subscriptions
Reference for workspace subscriptions: the mySubscribe mutation, the mySubscriptions query, and the subscription, filter, and order types they use.
The subscriptions of the caller's workspace to plans and branches: how to subscribe, how to list them, and the types they return.
Queries
mySubscriptions
The caller's own workspace's subscriptions, most recent first.
Answers where myAvailablePlans cannot: a subscription to a plan that has since been archived, or whose active window closed, or whose target list no longer includes the workspace, is absent from the catalogue but still in effect. This is the query for "what am I on".
mySubscriptions(
filter: BillingWorkspaceSubscriptionFilter
first: Int
after: String
last: Int
before: String
orderBy: BillingSubscriptionOrder = { field: SUBSCRIBED_AT, direction: DESC }
): BillingWorkspaceSubscriptionConnection!Arguments
filter
BillingWorkspaceSubscriptionFilter
Filtering options for the returned subscriptions.
orderBy
BillingSubscriptionOrder
The ordering options for the returned subscriptions.
Input types:
Output types:
Mutations
mySubscribe
Subscribes the caller's own workspace to a plan, optionally on a branch.
The workspace is not in the input. It is the one the caller's token names, so this mutation cannot put a tenant the token does not name onto a paid plan. A token carrying no workspace claim is refused.
The caller also needs a role that grants the billing product. Without one, the call fails with PERMISSION_DENIED.
The plan is validated before the subscription is taken: the plan, or the branch, must be a row that myAvailablePlans offers the workspace; the branch must belong to the plan; and no product of the plan may be covered by one of the workspace's active subscriptions. A token whose workspace claim names no workspace in this deployment fails with VALIDATION_ERROR. A workspace gets at most one trial per plan: once a subscription to the plan or to one of its branches has carried a trial, later ones start without.
Arguments
input
BillingMySubscribeInput!
The plan, and optionally the branch. The workspace is the caller's own and is not passed in.
Input types:
Output types:
Objects
BillingWorkspaceSubscription
A workspace's own view of one of its subscriptions: the plan and branch as ids, and the dates.
Not a Node. Read a subscription through mySubscriptions. myAvailablePlans shows an active subscription on the row of its exact plan and branch, for as long as the catalogue still offers that row.
id
ID!
The identifier of the subscription.
workspaceId
ID!
The workspace holding it.
planId
ID!
The plan subscribed to.
branchId
ID
The branch, when the subscription is to one rather than to the base plan.
BillingWorkspaceSubscribePayload
What mySubscribe answers with.
Inputs
BillingWorkspaceSubscriptionFilter
Filtering options for the caller's own subscriptions. Fields combine with AND.
No workspace field: the workspace is the caller's own and is never accepted from outside.
planId
ID
Filter by plan.
BillingMySubscribeInput
Input for subscribing the caller's own workspace to a plan.
It has no workspace field: the workspace is the one the caller's token names.
planId
ID!
The plan to subscribe to.
branchId
ID
Optional plan branch (null = subscribe to the base plan).
BillingSubscriptionOrder
Ordering options for subscriptions.
Enums
BillingSubscriptionStatus
Lifecycle status of a workspace's subscription.
ACTIVE
The subscription is currently in effect.
CANCELLED
The subscription has been cancelled (replaced by another or stopped explicitly).
BillingSubscriptionOrderField
Fields available for ordering subscriptions.
SUBSCRIBED_AT
Order by when the workspace subscribed.
Pagination types
BillingWorkspaceSubscriptionConnection
A page of the caller's own subscriptions.
Implements: Connection
BillingWorkspaceSubscriptionEdge
An edge in the BillingWorkspaceSubscription connection.
Implements: Edge
cursor
String!
An opaque cursor for this edge.
See also
Last updated
Was this helpful?