POINTS API 

Omega Point's "Points API" evaluates the complexity of executing a particular query so that you can achieve optimal performance with the API.

To know the complexity of any query, simply add the “meta” node, as seen here:

query{
  meta {
    points {
      cost
    }
  }
}

The response structure looks like the following:

{
  "data": {
    "meta": {
      "points": {
        "cost": 221
      }
    }
  }
}

In most cases, building queries that are between 100-500 points will achieve the optimal performance. If an application is making multiple queries for data that is below that range, it can always use aliases in GraphQL to increase the amount of data returned in a single request. If the queries are above that range, then splitting the query into multiple requests can improve performance as well.

ESTIMATING POINTS PRIOR TO EXECUTION 

The Points API can also estimate the cost of a query without actually running it. By sending the exact query to https://api.ompnt.com/graphql?estimate=true — which is the same API URL, but with an additional "estimate=true" parameter — the query will not run. Instead, the API will return the data structure above that includes the estimated cost.

RATE LIMITING ON COMPLEX QUERIES

In order to protect against excessive calls to Omega Point's server, there is a limitation on queries that are above 5000 points.  If a query exceeds the rate limit threshold, the Omega Point API will return an error with the HTTP status code 429. 

We are working to evolve this limit to better support various queries so please contact [email protected] for queries that exceed this threshold. 

Did this answer your question?