Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs on how to pass schema for newer BuckleScript releases. #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,20 @@ npm run send-introspection-query http://my-api.example.com/api

If you've already got a schema file downloaded for other purposes, you can tell
graphql_ppx to use that one by updating the "ppx-flags" in `bsconfig.json`.
Note: no space around the equal sign!
The syntax for passing arguments to a ppx is dependent on the version of
BuckleScript you are using and, consequently, is only available in BuckleScript 5.1.0+.
On older versions of BuckleScript there is no way to pass the ppx argument, so
you will have to symlink your schema file to `graphql_schema.json`, relying on
graphql_ppx's default filename loading to read your custom schema file.

Note: no space around the equal sign! Note also that the ppx and arguments are
supplied as a nested array. If you supply them simply as strings, BuckleScript
will treat each argument as its own ppx.

```json
{
"ppx-flags": [
"graphql_ppx/ppx\\ -schema=your_schema.json"
["graphql_ppx/ppx", "-schema=your_schema.json"]
]
}
```
Expand Down