Querying a single plan

You can query a single plan by using the plan query:

plan(id:ID,latest:Boolean)

Parameter

Description

id

The plan's unique identifier (required)

latest

Whether to fetch the latest version even if unpublished

For example, to fetch a plan:

{
plan(id:"2358ankfjp8k1zpau7ayphbfmhfzr") {
displayName
label
cost
state
}
}

This would return something like:

{
"data": {
"plan": {
"displayName": "My Plan",
"label": "my-plan",
"cost": 123,
"state": "AVAILABLE"
}
}
}

Fetching an unpublished plan

To get an still-unpublished plan (or modifications to an existing plan that still haven't been published), you can use the latest parameter:

{
plan(id:"2358ankfjp8k1zpau7ayphbfmhfzr", latest:true) {
displayName
label
cost
state
}
}

This would return the latest data, whether it's been published or not.