Skip to content

Latest commit

 

History

History
75 lines (68 loc) · 1.91 KB

File metadata and controls

75 lines (68 loc) · 1.91 KB

API - GraphQL Query Documentation with examples

Quick links:

Entities:

Extras:

Examples:

Introduction

GraphQL queries follow this basic structure:

{
  object (arguments) {
    fields
  }
}

The resultant data follows the same structure as the query

{
  "data": {
    "object": {
      "field": value
    }
  }
}

There is also an extensions block in addition to the data response. This follows the GraphQL specifications and allows us to write more detailed responses, including information regarding pagination and aggregations.

  "extensions": {
    "aggregations": {
      "department": {
        "buckets": [
          {
            "key": "Drawings, Prints, and Graphic Design Department",
            "doc_count": 129079
          },
          {
            "key": "Product Design and Decorative Arts Department",
            "doc_count": 28924
          },
          ...
        ]
      }
    },
    "pagination": {
      "hits": 196951,
      "per_page": 10,
      "current_page": 0,
      "number_of_pages": 19696
    }
  }