The IGSDB provides access to its database of products via a GraphQL API. This document provides a quick overview on the API and some examples of how to list, filter and retrieve product information.
GraphQL is an open-source data query and manipulation language for APIs. Unlike more traditional REST-based APIs, GraphQL APIs allow queries that can pull arbitrary data from nested relationships (the 'graph') with one query. One of the motivation behind GraphQL was to address the issues of overfetching and underfetching data often experienced when using REST APIs.
The IGSDB GraphQL API is located here:
https://igsdb-development.herokuapp.com/graphql
If you visit this page using your browser, the IGSDB website provides you with an implementation of the "GraphiQL" web GUI to access the API. You can use this GUI to test queries against the API. NOTE: You must be logged in to access this page.
Here are a few queries you can use to exercise the GraphQL API:
List the 'product ID' and 'name' property of all products in the IGSDB database:
{
allProducts {
edges {
node {
productId
name
}
}
}
}
List the 'product ID' and 'name' property of all products in the IGSDB database of type 'glazing':
{
allProducts(type:"glazing") {
edges {
node {
productId
name
}
}
}
}
List the 'product ID' and 'name' property of all products in the IGSDB database that have 'white' in the name:
{
allProducts(name:"white") {
edges {
node {
productId
name
}
}
}
}