Home / Basics / Highnote API
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.
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/Field | Description | Cost |
---|---|---|
Objects | Objects represent data that consists of multiple fields. | One point |
Interfaces and unions | Interfaces 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 enums | Scalars 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 |
Connections | Connections 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 |
The following example demonstrates a more complex request complexity calculation that includes nested connection objects to illustrate how pagination cost can multiply:
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: