Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
richardguerre committed Jul 30, 2021
1 parent cb77058 commit 1b701be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ You can specify the following `options` in `createRelayMockEnvironmentHook(optio
| `customResolvers?` | `MockResolvers` | (optional) custom resolvers that are spread after use-relay-mock-environment's `ID` and `String` resolvers. `const resolvers = { ID() {...}, String() {...}, // your custom resolvers go here }` You can of course override the default `ID` and `String` resolvers by specifying your own. Read more about custom resolvers here: https://relay.dev/docs/guides/testing-relay-components/#mock-payload-generator-and-the-relay_test_operation-directive |
| `data?` | [`RelayMockData`](modules.md#relaymockdata) | (optional) an object containing overrides to the types/categories of each field, where each key is the `fieldName` or `parentTypeName` (see below). First specify the `parentTypeName` as the key, and the value is an object containing the `fieldName`(s) as the key(s). Example: `js const mockData = { users: { firstName: { mockType: 'faker.name.firstName' } } }` |
| `extendStringResolver?` | `MockResolver` | (optional) a function to extend use-relay-mock-environment's `String` resolver. **`param`** `context` is the mock resolver context (read more about it here: https://relay.dev/docs/guides/testing-relay-components/#mock-resolver-context) **`param`** `generateId` is a function to generate a globally unique ID number. |
| `fakerSeed?` | `number` | Runs `faker.seed(n)` with `n` being the number that you specify. You can alternatively give `seed` instead which accepts both a string or number. |
| `forceLoading?` | `boolean` | (optional) Whether to force loading and don't resolve any GraphQL operation. |
| `generatorOptions?` | `MockPayloadGeneratorOptions` | (optional) mock generator options. Please read documentation of type MockPayLoadGeneratorOptions. |
| `instantInitialLoading?` | `boolean` | (optional) Whether to instantly load the GraphQL operation. By default there is a 300ms loading time to mimick real-world network conditions. This only applies to the initial loading. If you would like to change the loading time, set `loadTime` instead. |
Expand Down
10 changes: 5 additions & 5 deletions docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const mockData = {

#### Defined in

[index.ts:87](https://github.com/richardguerre/use-relay-mock-environment/blob/ceb8a73/src/index.ts#L87)
[index.ts:87](https://github.com/richardguerre/use-relay-mock-environment/blob/cb77058/src/index.ts#L87)

___

Expand Down Expand Up @@ -68,7 +68,7 @@ You can specify one or more of the following:

#### Defined in

[index.ts:26](https://github.com/richardguerre/use-relay-mock-environment/blob/ceb8a73/src/index.ts#L26)
[index.ts:26](https://github.com/richardguerre/use-relay-mock-environment/blob/cb77058/src/index.ts#L26)

___

Expand All @@ -80,7 +80,7 @@ Same as the `RelayMockOptions` below.

#### Defined in

[index.ts:166](https://github.com/richardguerre/use-relay-mock-environment/blob/ceb8a73/src/index.ts#L166)
[index.ts:166](https://github.com/richardguerre/use-relay-mock-environment/blob/cb77058/src/index.ts#L166)

___

Expand All @@ -103,7 +103,7 @@ ___

#### Defined in

[index.ts:93](https://github.com/richardguerre/use-relay-mock-environment/blob/ceb8a73/src/index.ts#L93)
[index.ts:93](https://github.com/richardguerre/use-relay-mock-environment/blob/cb77058/src/index.ts#L93)

## Functions

Expand Down Expand Up @@ -141,4 +141,4 @@ a function that is the `useRelayMockEnvironment()` React hook. Read more about i

#### Defined in

[index.ts:181](https://github.com/richardguerre/use-relay-mock-environment/blob/ceb8a73/src/index.ts#L181)
[index.ts:181](https://github.com/richardguerre/use-relay-mock-environment/blob/cb77058/src/index.ts#L181)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.1",
"version": "1.2.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit 1b701be

Please sign in to comment.