Queries
Queries define GraphQL operations which retrieve data from the server. They return only the data you specify, based on the fields which you provide in a query. If an object is returned, then you must specify the fields of that object which you want to return. The final result of the query must only return scalars.
At the start of every query operation, ensure that you specify query
before the field(s).
Query Variables
We use variables throughout our example requests. We do this in order to mirror real-world application practices whereby you would most likely want dynamic values for your arguments. Take a look at this guide if you're unfamiliar with how variables work in GraphQL.
feature
Retrieve a Feature.
Arguments
Name | Type | Description |
---|---|---|
| The id of the feature. This maps to the |
Returns
Name | Type | Description |
---|---|---|
| The Feature corresponding to the | |
| Returns any errors which may have occurred with the request. |
Examples
features
List allFeatures.
Returns
Name | Type | Description |
---|---|---|
| An array of all features. | |
| Returns any errors which may have occurred with the request. |
Examples
canUseFeature
Understand if a User is able to use a particular Feature.
The returned access
boolean is true
when the user has access (for Binary features), has enough of a feature remaining to be used (for Consumable features), or has overage enabled (for Consumable features).
Arguments
Name | Type | Description |
---|---|---|
| The id of the feature. This maps to the | |
| The id of the user. This maps to the | |
| The amount of the consumable feature which the user will be using and you want to check access against. Defaults to |
Returns
Name | Type | Description |
---|---|---|
| An object containing details on if the user can use the feature ( | |
| Returns any errors which may have occurred with the request. |
Examples
showUsage
Retrieve both the current and historical usage of a Feature for a User.
Why can I only see the current usage through the SDKs?
We're in the process of returning past usage of a feature via our SDKs. Let us know if you'd love to see it and we'll keep you posted on when it's launched!
Arguments
Name | Type | Description |
---|---|---|
| The id of the user. This maps to the | |
| The id of the feature. This maps to the |
Returns
Name | Type | Description |
---|---|---|
| An object containing details on the how many of the feature a user has used ( | |
| Returns any errors which may have occurred with the request. |
Examples
package
Retrieve a Package.
Arguments
Name | Type | Description |
---|---|---|
| The id of the package. This maps to the | |
| SDK Only. Whether you want a |
Returns
Name | Type | Description |
---|---|---|
| The Package corresponding to the | |
| Returns any errors which may have occurred with the request. |
Examples
packages
List all Packages.
Arguments
Name | Type | Description |
---|---|---|
| ||
| SDK Only. Whether you want a |
Returns
Name | Type | Description |
---|---|---|
| An array of all packages. | |
| Returns any errors which may have occurred with the request. |
Examples
user
Retrieve a User.
Arguments
Name | Type | Description |
---|---|---|
| The id of the user. This maps to the |
Returns
Name | Type | Description |
---|---|---|
| The User corresponding to the | |
| Returns any errors which may have occurred with the request. |
Examples
users
List all Users.
Returns
Name | Type | Description |
---|---|---|
| An array of all users. | |
| Returns any errors which may have occurred with the request. |
Examples
subscription
Retrieve a PackageSubscription.
Arguments
Name | Type | Description |
---|---|---|
| The id of the subscription. This maps to the |
Returns
Name | Type | Description |
---|---|---|
| The PackageSubscription of a user to a package. This corresponds to the | |
| Returns any errors which may have occurred with the request. |
Examples
subscriptions
List all PackageSubscriptions, or all PackageSubscriptions associated to a User.
Arguments
Name | Type | Description |
---|---|---|
| The id of the User whose PackageSubscriptions you want to fetch. |
Returns
Name | Type | Description |
---|---|---|
| A list of subscriptions. These could correspond to a User if a | |
| Returns any errors which may have occurred with the request. |
Examples
Last updated