Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.11 KB

DEVELOPING.md

File metadata and controls

56 lines (38 loc) · 1.11 KB

Developing

This document describes how to develop and test this ppx plugin. This is a different workflow than when consuming this ppx plugin for use in npm. It involves installing native opam packages as dependencies.

Developing With opam

OPAM is a package and environment manager for OCaml. To work on graphql_ppx using OPAM, you first need to make sure you're running on OCaml version 4.02.3:

opam init
opam switch 4.02.3
eval `opam config env`

Then, you can install and build graphql_ppx:

opam pin add graphql_ppx_base . -n
opam install graphql_ppx_base --deps-only  # Downloads and builds the OCaml dependencies
make  # Builds graphql_ppx itself

Test

You first need to install the JavaScript dependencies to run the test suite:

npm install  # Or yarn install if you're using Yarn

Then, simply run

make test

to run the tests.

Developing With esy

You can work on the GraphQL ppx plugin by installing native dependencies using esy (esy is like npm for native).

Install Dependencies And Build

npm install -g esy@preview
esy install
esy build