Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Metaphysics is a GraphQL-compliant API that wraps various Artsy APIs. You can try it here against our staging API.

It is built on express, express-graphql, and graphql. With graphiql providing a sandbox to work with.

It is currently used in production all over the place in, and the Artsy iOS App

Meta CircleCI codecov

Getting Setup

To get yourself set up with all the project's dependencies:

git clone
cd metaphysics

# Install node modules
yarn install
# Installed system tools (like cache servers)
brew bundle
# Get set up with a default env
cp .env.oss .env

For Artsy staff wanting to expand on your .env, you can use hokusai staging env get to see staging's env vars. Or better yet, use copy_env to match staging:

copy_env hokusai

That command will dump the env vars from staging and do a find/replace on the keys from staging that are listed as REPLACE in the example file.


With your dependencies set up, you can run Metaphysics by running:

yarn dev

Which will start the server on http://localhost:5001

Recommended: You can run the commands inside the terminal in VS Code, then the debugger will be hooked up by default.

Setting up your local GraphiQL

We recommend the client for testing queries locally.

You will need to set up headers with both:

  • x-access-token - Open, sign in and evaluate sd.CURRENT_USER.accessToken in a dev console (CMD+Shift+C in Chrome).
  • x-user-id - As above, but

If you're new to GraphQL, you can checkout Artsy's GraphQL Workshop.

Sample Queries

Once you have the GraphiQL client running against your local service, you can verify things are working by executing these queries:

Get popular artists

  popular_artists {
    artists {

Get your account information

  me {

If any of these queries fail, it's probable that you misconfigured your x-access-token or x-user-id HTTP headers.


Docker and Kubernetes setup

This is deployed using Hokusai to manage Docker and Kubernetes. To replicate this:

  • Install Docker for Mac and Hokusai

    $ brew tap caskroom/cask && brew cask install docker
    $ pip install hokusai

    If you are using your system Python distribution, you may need to run this as:

    $ sudo pip install hokusai --ignore-installed
  • Configure Hokusai

    hokusai configure --kubectl-version {{ kubectl_version }} --s3-bucket {{ kubectl_config_s3_bucket }} --s3-key {{ kubectl_config_s3_key }}
    hokusai check

    Artsy staff should find follow the instructions in


  • Run tests in the Docker Compose test stack via Hokusai:

    hokusai test
  • Or, to run tests locally: npm test to run the entire suite npm run watch to spin up the test watcher

About Artsy

This project is the work of engineers at Artsy, the world's leading and largest online art marketplace and platform for discovering art. One of our core Engineering Principles is being Open Source by Default which means we strive to share as many details of our work as possible.

You can learn more about this work from our blog and by following @ArtsyOpenSource or explore our public data by checking out our API. If you're interested in a career at Artsy, read through our job postings!

You can’t perform that action at this time.