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

Mention new graphql ppx instead of old one #119

Merged
merged 3 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,40 @@ Reason bindings for Formidable's Universal React Query Library, [`urql`](https:/
yarn add reason-urql bs-fetch
```

#### 2. Add `graphql_ppx`.
#### 2. Add `graphql_ppx_re`.

This project uses [`graphql_ppx`](https://github.com/mhallin/graphql_ppx) to type check your GraphQL queries, mutations, and subscriptions **at compile time**. You'll need to add it as a dev dependency.
This project uses [`graphql_ppx_re`](https://github.com/baransu/graphql_ppx_re) (which is based on [graphql_ppx](https://github.com/mhallin/graphql_ppx)) to type check your GraphQL queries, mutations, and subscriptions **at compile time**. You'll need to add it as a dev dependency.
huy-nguyen marked this conversation as resolved.
Show resolved Hide resolved

```sh
yarn add graphql_ppx --dev
yarn add @baransu/graphql_ppx_re --dev
```

#### 3. Update `bsconfig.json`.

Add `reason-urql` to your `bs-dependencies` and `graphql_ppx/ppx` to your `ppx_flags` in `bsconfig.json`.
Add `reason-urql` to your `bs-dependencies` and `graphql_ppx_re` to your `ppx_flags` in `bsconfig.json`.

```json
{
"bs-dependencies": ["reason-urql"],
"ppx-flags": ["graphql_ppx/ppx"]
"ppx-flags": ["@baransu/graphql_ppx_re/ppx"]
}
```
If you're using `bs-platform` 6.x, use this value for the `"ppx_flags"` instead:
```json
{
"ppx-flags": ["@baransu/graphql_ppx_re/ppx6"]
}
```

#### 4. Send an introspection query to your API.

Finally, you'll need to send an introspection query to your GraphQl API. This allows `graphql_ppx` to generate a `graphql_schema.json` at the root of your project that it can use to type check your queries. **You should check this file into version control** and keep it updated as your API changes. To do this:
Finally, you'll need to send an introspection query to your GraphQl API. This allows `@baransu/graphql_ppx_re` to generate a `graphql_schema.json` at the root of your project that it can use to type check your queries. **You should check this file into version control** and keep it updated as your API changes. To do this:

```sh
yarn send-introspection-query <your_graphql_endpoint>
```

Simply re-run this script at anytime to regenerate the `graphql_schema.json` file. See the [docs for `graphql_ppx`](https://github.com/mhallin/graphql_ppx) for more assistance.
Simply re-run this script at anytime to regenerate the `graphql_schema.json` file. See the [docs for `graphql_ppx_re`](https://github.com/baransu/graphql_ppx_re#usage) for more assistance.

### Older Versions

Expand Down
2 changes: 1 addition & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
"warnings": {
"error": "+5"
},
"ppx-flags": ["graphql_ppx/ppx"]
"ppx-flags": []
huy-nguyen marked this conversation as resolved.
Show resolved Hide resolved
}