Home / Basics / Highnote API

Request Complexity

Request complexity calculation

Request complexity only applies to Highnote’s GraphQL API.

The Highnote API calculates request complexity differently based on whether you send a query or mutation to the API.

  • Query: Query cost is based on the types and fields requested.
  • Mutation: Mutations have a base cost of 10, plus any additional costs based on the types and fields requested.

Type and field cost values

The cursor and pageInfo fields of a request cost zero points because they are a result of connection objects.

The following table represents each type or field used in a request and its associated cost:

Type/FieldDescriptionCost
ObjectsObjects represent data that consists of multiple fields.One point
Interfaces and unionsInterfaces and unions function similarly to objects in GraphQL, as they allow for returning multiple types of data. Because interfaces and unions can return multiple types of data, only the most expensive type requested is counted.One point
Scalars and enumsScalars are types that return a final value, such as strings, integers, and IDs. Enums return one of a predefined set of values. Scalars and enums have minimal cost since they are already accounted for in the object they belong to, so no extra lookups are needed.Zero points
ConnectionsConnections represent relationships between different data entities. They allow you to define how different types of data are connected and how they can be queried.Two points plus the number of objects requested

Example 1

The following example demonstrates a simple request complexity calculation:

Example 1
Request Calculation

Example 2

The following example demonstrates a more complex request complexity calculation that includes nested connection objects to illustrate how pagination cost can multiply:

Example 2
Request Calculation

Request cost in GraphQL responses

Request cost information is included in API responses under the extensions field. We recommend testing a query or mutation of your choosing using the API Explorer to examine the request’s cost.

The following example represents a request cost response in an API request that is not rate-limited:

Query Cost Response

Provide Feedback

Was this content helpful?