Skip to content

Commit

Permalink
Remove flow-type parameters from Relay API references
Browse files Browse the repository at this point in the history
Summary: Our APIs no longer require explicit flow type annotations. This diff updates the documentation to reflect that.

Reviewed By: voideanvalue

Differential Revision: D48647669

fbshipit-source-id: d141fa5e4dbb24eaff8124351e30c3bd50f22fd7
  • Loading branch information
alunyov authored and facebook-github-bot committed Aug 24, 2023
1 parent 9a1ea37 commit 0ce764a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 31 deletions.
5 changes: 0 additions & 5 deletions website/docs/api-reference/hooks/load-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ const queryReference = loadQuery(
* `environmentProviderOptions`: *[Optional]* options object
* Options passed to an `environmentProvider` used in `prepareSurfaceEntryPoint.js`.

### Flow Type Parameters

* `TQuery`: Type parameter that should correspond to the Flow type for the specified query. This type is available to import from the the auto-generated file: `<query_name>.graphql.js`.
* `TEnvironmentProviderOptions`: The type of the `environmentProviderOptions` parameter.

### Return Value

A query reference with the following properties:
Expand Down
4 changes: 0 additions & 4 deletions website/docs/api-reference/hooks/use-lazy-load-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ function App() {
* `fetchKey`: A `fetchKey` can be passed to force a re-evaluation of the current query and variables when the component re-renders, even if the variables didn't change, or even if the component isn't remounted (similarly to how passing a different `key` to a React component will cause it to remount). If the `fetchKey` is different from the one used in the previous render, the current query will be re-evaluated against the store, and it might be refetched depending on the current `fetchPolicy` and the state of the cache.
* `networkCacheConfig`: *_[Optional] _* Default value: `{force: true}`. Object containing cache config options for the *network layer*. Note that the network layer may contain an *additional* query response cache which will reuse network responses for identical queries. If you want to bypass this cache completely (which is the default behavior), pass `{force: true}` as the value for this option.
### Flow Type Parameters
* `TQuery`: Type parameter that should correspond to the Flow type for the specified query. This type is available to import from the the auto-generated file: `<query_name>.graphql.js`.
### Return Value
* `data`: Object that contains data which has been read out from the Relay store; the object matches the shape of specified query.
Expand Down
5 changes: 0 additions & 5 deletions website/docs/api-reference/hooks/use-mutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ function LikeButton() {

<FbUseMutationParameter />


### Flow Type Parameters

* `TMutation`: Type parameter that should corresponds the Flow type for the mutation query. This type is available to import from the the auto-generated file: `<mutationName>.graphql.js`.

### Return Value

Tuple containing the following values:
Expand Down
5 changes: 0 additions & 5 deletions website/docs/api-reference/hooks/use-subscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ function UserComponent({ id }) {
* `config`: a config of type [`GraphQLSubscriptionConfig`](#type-graphqlsubscriptionconfigtsubscriptionpayload) passed to [`requestSubscription`](../request-subscription/)
* `requestSubscriptionFn`: `?<TSubscriptionPayload>(IEnvironment, GraphQLSubscriptionConfig<TSubscriptionPayload>) => Disposable`. An optional function with the same signature as [`requestSubscription`](../request-subscription/), which will be called in its stead. Defaults to `requestSubscription`.


<GraphQLSubscriptionConfig />

### Flow Type Parameters

* `TSubscriptionPayload`: The type of the payloads vended by the subscription. You should pass the flow type imported from the auto-generated `.graphql` file corresponding to the subscription, e.g. use `UserDataSubscription` as the type parameter, from `import type {UserDataSubscription} from './__generated__/UserDataSubscription.graphql'`;

### Behavior

* This is only a thin wrapper around the `requestSubscription` API. It will:
Expand Down
8 changes: 0 additions & 8 deletions website/docs/api-reference/relay-runtime/commit-mutation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ function likeFeedback(environment: IEnvironment): Disposable {

<MutationConfig />

### Flow Type Parameters

* `TMutation`: Type parameter that should corresponds the Flow type for the mutation query. This type is available to import from the the auto-generated file: `<mutationName>.graphql.js`.
* Note that this auto-generated type will implement `MutationParameters`.

:::caution
If you do not **explicitly** pass this type parameter, the variables, optimistic response and response passed to `onCompleted` **will not be type-checked**!
:::

### Return Value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ function createSubscription(environment: IEnvironment): Disposable {

<GraphQLSubscriptionConfig />

### Flow Type Parameters

* `TSubscriptionPayload`: The type of the payloads vended by the subscription. You should pass the flow type imported from the auto-generated `.graphql` file corresponding to the subscription, e.g. use `UserDataSubscription` as the type parameter, from `import type {UserDataSubscription} from './__generated__/UserDataSubscription.graphql'`;

### Return Type

* A [`Disposable`](#interface-disposable) that clears the subscription.
Expand Down

0 comments on commit 0ce764a

Please sign in to comment.