This repository demonstrates how to setup a skeleton coprocessor that simply logs the payload
from the Router.
Note: To run this example, you will need a GraphOS Enterprise plan and must create
/router/.env
based on/router/.env.example
which exportsAPOLLO_KEY
andAPOLLO_GRAPH_REF
.
- Run the subgraph from the
/subgraph
directory withnpm run dev
- Run the coprocessor based on your language of choice by following the README from the appropriate
/*-coprocessor
directory (javascript, Java, golang). - In the
/router
directory, download the router by running./download_router.sh
- In the
/router
directory, compose the schema by running./create_local_schema.sh
- In the
/router
directory, run the router by running./start_router.sh
Now if you run this code in the browser (http://127.0.0.1:4000/), you will be able to query the router and you will see the payload
logged in the terminal by the coprocessor.
In router/router-config.yaml
, the coprocessor is configured with the Router to be called on the router
request
stage.