Skip to content

Commit

Permalink
Fix typo in testing-relay-with-preloaded-queries.md (#4405)
Browse files Browse the repository at this point in the history
Summary:
Update `testing-relay-with-preloaded-queries.md`

Pull Request resolved: #4405

Reviewed By: alunyov

Differential Revision: D48989110

Pulled By: captbaritone

fbshipit-source-id: 054a279f8fc743d40b8d4943a5a67f381de61fed
  • Loading branch information
Uk1288 authored and facebook-github-bot committed Oct 6, 2023
1 parent 3b9f90a commit 610806b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion website/docs/guides/required-directive.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This value should not be null, and the component **cannot render without it**. I

## Locality

A field's `@required` status is **local to the fragment where it is specified**. This allows you to add add/remove the directive without having to think about anything outside the scope of your component.
A field's `@required` status is **local to the fragment where it is specified**. This allows you to add/remove the directive without having to think about anything outside the scope of your component.

This choice reflects the fact that some components may be able to recover better from missing data than others. For example, a `<RestaurantInfo />` component could probably render something sensible even if the restaurant's address is missing, but a `<RestaurantLocationMap />` component might not.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ This is more straightforward - it is done via a call to `environment.mock.queueP
* Used a different query - the query resolver would not be called, `currentOperation` will be `null`
* Query variables don't match - the query resolver would not be called, `currentOperation` will be `null` (make sure to inspect the `variables`).
* Also, make sure arrays are in the same order, if any (or better yet, use sets, if at all possible).
* If data returned rom the query is not what you expect, make sure you're generating the right graphql type.
* If data returned from the query is not what you expect, make sure you're generating the right graphql type.
* You can tell you're mocking the wrong one if the return values look something like `<mock-value-for-field-"formatted_amount">`


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ This is more straightforward - it is done via a call to `environment.mock.queueP
* Used a different query - the query resolver would not be called, `currentOperation` will be `null`
* Query variables don't match - the query resolver would not be called, `currentOperation` will be `null` (make sure to inspect the `variables`).
* Also, make sure arrays are in the same order, if any (or better yet, use sets, if at all possible).
* If data returned rom the query is not what you expect, make sure you're generating the right graphql type.
* If data returned from the query is not what you expect, make sure you're generating the right graphql type.
* You can tell you're mocking the wrong one if the return values look something like `<mock-value-for-field-"formatted_amount">`


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ This is more straightforward - it is done via a call to `environment.mock.queueP
* Used a different query - the query resolver would not be called, `currentOperation` will be `null`
* Query variables don't match - the query resolver would not be called, `currentOperation` will be `null` (make sure to inspect the `variables`).
* Also, make sure arrays are in the same order, if any (or better yet, use sets, if at all possible).
* If data returned rom the query is not what you expect, make sure you're generating the right graphql type.
* If data returned from the query is not what you expect, make sure you're generating the right graphql type.
* You can tell you're mocking the wrong one if the return values look something like `<mock-value-for-field-"formatted_amount">`


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This value should not be null, and the component **cannot render without it**. I

## Locality

A field's `@required` status is **local to the fragment where it is specified**. This allows you to add add/remove the directive without having to think about anything outside the scope of your component.
A field's `@required` status is **local to the fragment where it is specified**. This allows you to add/remove the directive without having to think about anything outside the scope of your component.

This choice reflects the fact that some components may be able to recover better from missing data than others. For example, a `<RestaurantInfo />` component could probably render something sensible even if the restaurant's address is missing, but a `<RestaurantLocationMap />` component might not.

Expand Down Expand Up @@ -116,7 +116,7 @@ fragment MyFrag on Actor {
}
```

In this situation Relay will generate a union type like: `{__typename: 'User', name: string} | {__typename: '%ignore this%}`. Now you can check the `__typename` field to narrow your object's type down to one that has a non-nullalble `name`.
In this situation Relay will generate a union type like: `{__typename: 'User', name: string} | {__typename: '%ignore this%}`. Now you can check the `__typename` field to narrow your object's type down to one that has a non-nullable `name`.

<FbInternalOnly>
Example diff showing the adoption of this strategy: D24370183
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ This is more straightforward - it is done via a call to `environment.mock.queueP
* Used a different query - the query resolver would not be called, `currentOperation` will be `null`
* Query variables don't match - the query resolver would not be called, `currentOperation` will be `null` (make sure to inspect the `variables`).
* Also, make sure arrays are in the same order, if any (or better yet, use sets, if at all possible).
* If data returned rom the query is not what you expect, make sure you're generating the right graphql type.
* If data returned from the query is not what you expect, make sure you're generating the right graphql type.
* You can tell you're mocking the wrong one if the return values look something like `<mock-value-for-field-"formatted_amount">`


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This value should not be null, and the component **cannot render without it**. I

## Locality

A field's `@required` status is **local to the fragment where it is specified**. This allows you to add add/remove the directive without having to think about anything outside the scope of your component.
A field's `@required` status is **local to the fragment where it is specified**. This allows you to add/remove the directive without having to think about anything outside the scope of your component.

This choice reflects the fact that some components may be able to recover better from missing data than others. For example, a `<RestaurantInfo />` component could probably render something sensible even if the restaurant's address is missing, but a `<RestaurantLocationMap />` component might not.

Expand Down Expand Up @@ -116,7 +116,7 @@ fragment MyFrag on Actor {
}
```

In this situation Relay will generate a union type like: `{__typename: 'User', name: string} | {__typename: '%ignore this%}`. Now you can check the `__typename` field to narrow your object's type down to one that has a non-nullalble `name`.
In this situation Relay will generate a union type like: `{__typename: 'User', name: string} | {__typename: '%ignore this%}`. Now you can check the `__typename` field to narrow your object's type down to one that has a non-nullable `name`.

<FbInternalOnly>
Example diff showing the adoption of this strategy: D24370183
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ This is more straightforward - it is done via a call to `environment.mock.queueP
* Used a different query - the query resolver would not be called, `currentOperation` will be `null`
* Query variables don't match - the query resolver would not be called, `currentOperation` will be `null` (make sure to inspect the `variables`).
* Also, make sure arrays are in the same order, if any (or better yet, use sets, if at all possible).
* If data returned rom the query is not what you expect, make sure you're generating the right graphql type.
* If data returned from the query is not what you expect, make sure you're generating the right graphql type.
* You can tell you're mocking the wrong one if the return values look something like `<mock-value-for-field-"formatted_amount">`


Expand Down

0 comments on commit 610806b

Please sign in to comment.