GraphQL

GraphQL is a relatively new API query language that the Museum has adopted to build online applications. Developed as an open source project by Facebook, the main features of GraphQL are:

  • Thin server-side layer that sits on top of multiple data sources, making it database agnostic.
  • Queries only return the declared fields and can fetch across different resources — all in one go.
  • Type based system, with libraries available on all major languages (Javascript, PHP, Python, Ruby, Java etc).
  • Single endpoint, in our case https://api.maas.museum/graphql.
  • Accompanied by GraphiQL, a GUI based developer tool accessible here.
  • Self documenting, parts of this documentation come directly from the code.

Types

Similar to REST resources, GraphQL uses a type based system to organise data. Currently, we have three documented types (and a few undocumented ones):

These types are stable, however if any changes are made, we will issue deprecation notices in advance.

Examples

Query 100 objects, skipping the first 20.

Resources

For more information about GraphQL, check out these links:

While most development work has been concentrated on GraphQL, we also have a public REST API.