Skip to main content

What you’ll need

  • Base URL:
    POST https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql
    
  • API key to include in the request headers: x-api-key: YOUR_API_KEY
    The Learning Commons team will securely share an API key for the GraphQL endpoint with you separately.
  • For Python: gql for better GraphQL support, schema validation, and error handling
    pip install gql[requests]
    

Query the data

Use GraphQL queries to fetch the Knowledge Graph data you’re interested in. For example, you can retrieve up to 5 courses with identifiers, names, and academic subjects using the queries below:
curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{"query":"{ courses(limit: 5) { identifier name academicSubject } }"}' \
  https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql

Troubleshooting

Query too complex

If your query times out or fails:
  • Reduce the depth of nested relationships
  • Implement pagination on nested connections
  • Split complex queries into multiple simpler ones

No results returned

If your query returns an empty response:
  • Check filter conditions are correct
  • Verify field names match the schema
  • Use introspection queries to explore available fields

Authentication errors

If your query fails authentication:
  • Ensure your API key is valid and active
  • Check that the x-api-key header is properly set

Rate limiting

The API implements rate limiting to ensure fair usage:
  • 2 requests per second with burst capacity up to 10 requests
  • Exponential backoff when receiving rate limit errors (HTTP 429: Too Many Requests)
Reach out to support@learningcommons.org ↗ to request rate limit adjustments.

Server errors

Large queries may cause HTTP 502/504 errors:
  • Reduce page size to fewer than 1000 items
  • Retry the query

Payload and timeout limits

The API has the following technical limitations:
  • Request timeout: 30 sec
  • Request payload size: 10 MB
  • Response payload size: 6 MB
  • Query complexity: Deeply nested queries may hit processing limits
To avoid limits:
  • Use pagination for large result sets
  • Limit field selection to only required data
  • Avoid deeply nested queries (>5 levels)
  • Break up complex queries or add filtering (e.g., grade level or subject)

GraphQL errors

GraphQL errors are returned in the response body:
{
  "errors": [
    {
      "message": "Field 'invalidField' doesn't exist on type 'Lesson'",
      "locations": [{"line": 2, "column": 5}]
    }
  ]
}