Skip to content

k-int/cooper-hewitt-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
    }
  }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published