Querying features

Plans have features of different kinds. These can be listed by using plan subqueries. These subqueries are standard pagination-supported queries. See Querying with Pagination for more details.

Fixed Features

Fixed features are mostly display-only features. These are the bulled points you can create in Plan Builder:

These features are not taken in account when calculating plan costs. They're part of the basic plan cost already. To fetch these features for a plan, you can use the fixedFeatures subquery:

fixedFeatures(
first: Int!,
after: String,
orderBy: FixedFeaturesOrderBy
): PlanFixedFeatureConnection

The result is a pagination connection containing a list of PlanFixedFeature nodes:

type PlanFixedFeature implements Node {
id: ID!
label: String!
displayName: String!
displayValue: String!
}

For example, for the plan in the screenshot above, the result of this query would be:

{
...
"fixedFeatures": {
"edges": [
{
"node": {
"displayName": "Checkbox feature",
"displayValue": "true"
}
},
{
"node": {
"displayName": "Text feature",
"displayValue": "Text Label 1"
}
}
]
},
...
}

Metered Features

Metered features are features that have an associated cost that depends on usage:

Fetching these features can be done with the meteredFeatures subquery:

meteredFeatures(
first: Int!,
after: String,
orderBy: MeteredFeaturesOrderBy
): PlanMeteredFeatureConnection

This returns paginated connection containing a list of PlanMeteredFeature nodes:

type PlanMeteredFeature implements Node {
id: ID!
label: String!
displayName: String!
numericDetails: PlanMeteredFeatureNumericDetails!
}
type PlanMeteredFeatureNumericDetails {
unit: String!
costTiers: [PlanFeatureCostTier!]
}
type PlanFeatureCostTier {
limit: Int!
cost: Int!
}

For example, the metered features shown in the screenshot above would return something like this:

{
...
"meteredFeatures": {
"edges": [
{
"node": {
"displayName": "Pay as you go feature",
"numericDetails": {
"unit": "unit",
"costTiers": [
{
"cost": 10000000,
"limit": 10000
}
]
}
}
}
]
}
...
}

Configurable Features

Configurable features are features that the user can customize, e.g. multiple choices, numeric ranges, etc.

To fetch these features, you can use the configurableFeatures subquery:

configurableFeatures(
first: Int!,
after: String,
orderBy: ConfigurableFeaturesOrderBy
): PlanConfigurableFeatureConnection

This query returns a paginated connection of PlanConfigurableFeature nodes:

type PlanConfigurableFeature implements Node {
id: ID!
label: String!
displayName: String!
upgradable: Boolean!
downgradable: Boolean!
type: PlanFeatureType!
featureOptions: [PlanConfigurableFeatureOption!]
numericDetails: PlanConfigurableFeatureNumericDetails
}
enum PlanFeatureType {
BOOLEAN,
STRING,
NUMBER
}
type PlanConfigurableFeatureOption {
displayName: String!
value: String!
cost: Int!
}
type PlanConfigurableFeatureNumericDetails {
increment: Int!
min: Int!
max: Int!
unit: String!
costTiers: [PlanFeatureCostTier!]
}
type PlanFeatureCostTier {
limit: Int!
cost: Int!
}

For the screenshot example, you would get the following result from this query:

{
...
"configurableFeatures": {
"edges": [
{
"node": {
"displayName": "Multiple choice feature",
"featureOptions": [
{
"displayName": "Choice 1",
"value": "choice-1",
"cost": 0
},
{
"displayName": "Choice 2",
"value": "choice-2",
"cost": 1000
},
{
"displayName": "Choice 3",
"value": "choice-3",
"cost": 2000
}
]
}
}
]
},
...
}