From 59b66f170484e5c24f1f9512b8529534bb0b0d86 Mon Sep 17 00:00:00 2001 From: Sequoia McDowell Date: Fri, 13 Dec 2019 06:34:18 -0500 Subject: [PATCH] Update refetchQueries with string options (#5641) * Update refetchQueries with string options `refetchQueries?: Array | RefetchQueriesFunction;` * Fixing refetchQueries docs * Changelog updates --- CHANGELOG.md | 3 ++- docs/shared/mutation-options.mdx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd51318dca3..b681e8353e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ [@mjlyons](https://github.com/mjlyons) in [#5388](https://github.com/apollographql/apollo-client/pull/5388) - Documentation updates.
- [@tomquirk](https://github.com/tomquirk) in [#5645](https://github.com/apollographql/apollo-client/pull/5645) + [@tomquirk](https://github.com/tomquirk) in [#5645](https://github.com/apollographql/apollo-client/pull/5645)
+ [@Sequoia](https://github.com/Sequoia) in [#5641](https://github.com/apollographql/apollo-client/pull/5641) ### GraphQL Anywhere vNext diff --git a/docs/shared/mutation-options.mdx b/docs/shared/mutation-options.mdx index 09de94d912a..55f36411f94 100644 --- a/docs/shared/mutation-options.mdx +++ b/docs/shared/mutation-options.mdx @@ -5,7 +5,7 @@ | `update` | (cache: DataProxy, mutationResult: FetchResult) | A function used to update the cache after a mutation occurs | | `ignoreResults`| boolean | If true, the returned `data` property will not update with the mutation result. | | `optimisticResponse` | Object | Provide a [mutation response](/features/optimistic-ui/) before the result comes back from the server | -| `refetchQueries`| (mutationResult: FetchResult) => Array<{ query: DocumentNode, variables?: TVariables}> | A function that allows you to specify which queries you want to refetch after a mutation has occurred | +| `refetchQueries`| (mutationResult: FetchResult) => Array<{ query: DocumentNode, variables?: TVariables}> | A function that allows you to specify which queries you want to refetch after a mutation has occurred, or an array of strings matching the **names** of queries to be refetched. | | `awaitRefetchQueries` | boolean | Queries refetched as part of `refetchQueries` are handled asynchronously, and are not waited on before the mutation is completed (resolved). Setting this to `true` will make sure refetched queries are completed before the mutation is considered done. `false` by default. | | `onCompleted` | (data: TData) => void | A callback executed once your mutation successfully completes | | `onError` | (error: ApolloError) => void | A callback executed in the event of an error. |