-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add final documentation updates for v3.
- Loading branch information
1 parent
c2fb94e
commit b063a90
Showing
26 changed files
with
2,855 additions
and
6,243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,23 +28,37 @@ Reason bindings for Formidable's Universal React Query Library, [`urql`](https:/ | |
|
||
## 💾 Installation | ||
|
||
#### 1. Install `reason-urql` and its `peerDependencies`. | ||
### 1. Install `reason-urql` and its `peerDependencies`. | ||
|
||
```sh | ||
yarn add reason-urql urql graphql | ||
``` | ||
|
||
We try to keep our bindings as close to latest `urql` as possible. However, `urql` tends to make releases a bit ahead of `reason-urql`. To get a compatible version, we recommend always staying strictly within this project's `peerDependency` range for `urql`. | ||
|
||
#### 2. Add `@reasonml-community/graphql-ppx`. | ||
#### 1a. **Important note for users of `bs-platform>=8.0.0`**. | ||
|
||
If using `bs-platform>=8.0.0` you'll need to use [`yarn resolutions`](https://classic.yarnpkg.com/en/docs/selective-version-resolutions/) to specify a specific version of `wonka` to resolve. `urql` has an explicit dependency on latest `wonka` `v4`, which is incompatible with `bs-platform>=8.0.0`. See [this issue](https://github.com/kitten/wonka/issues/85) for more details. | ||
|
||
In your `package.json`, add the following: | ||
|
||
```json | ||
"resolutions": { | ||
"wonka": "5.0.0-rc.1" | ||
} | ||
``` | ||
|
||
If you're using `npm`, you may need to stay on `[email protected]` until `urql` takes a dependency on `wonka>=5.0.0`. | ||
|
||
### 2. Add `@reasonml-community/graphql-ppx`. | ||
|
||
To get the most out of compile time type checks for your GraphQL queries, mutations, and subscriptions, we use [`@reasonml-community/graphql-ppx`](https://github.com/reasonml-community/graphql-ppx). Add this to your project's `devDependencies`. | ||
|
||
```sh | ||
yarn add @reasonml-community/graphql-ppx --dev | ||
``` | ||
|
||
#### 3. Update `bsconfig.json`. | ||
### 3. Update `bsconfig.json`. | ||
|
||
Add `reason-urql`, `wonka`, and `@reasonml-community/graphql-ppx` to your `bs-dependencies` and `@reasonml-community/graphql-ppx/ppx` to your `ppx_flags` in `bsconfig.json`. | ||
|
||
|
@@ -59,7 +73,7 @@ Add `reason-urql`, `wonka`, and `@reasonml-community/graphql-ppx` to your `bs-de | |
} | ||
``` | ||
|
||
#### 4. Send an introspection query to your API. | ||
### 4. Send an introspection query to your API. | ||
|
||
Finally, you'll need to send an introspection query to your GraphQl API, using a tool like [`graphql-cli`](https://github.com/Urigo/graphql-cli/). You should generate a file called `graphql_schema.json` at the root of your project that `graphql-ppx` can use to type check your queries. **You should check this file into version control** and keep it updated as your API changes. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.