-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QueryOptions
and QueryBaseOptions
interfaces
#3569
Conversation
`ApolloClient.query` is currently configured to accept `WatchQueryOptions`, which means the docs show people that passing things like `pollingInterval` into `ApolloClient.query` is supported (when in reality it's only supported when using `ApolloClient.watchQuery`). These changes add a new `QueryOptions` interface, and pull some of the common options out into a parent `QueryBaseOptions` interface. `ApolloClient.query` has been updated to use the `QueryOptions` interface, which should help clear up a bit of confusion. Fixes #3395.
Generated by 🚫 dangerJS |
@@ -672,17 +674,6 @@ export class QueryManager<TStore> { | |||
throw new Error('returnPartialData option only supported on watchQuery.'); | |||
} | |||
|
|||
if ((options as any).pollInterval) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hwillson it would probably be good to still throw here for people not using typescript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was on the fence on this one (I removed it just before committing). My logic was that once the option is properly removed from the docs, the number of people trying to use it should be greatly reduced. Then if it is provided by accident, it will just be ignored. But I guess it doesn't hurt to be extra communicative 📣. I'll add it back - thanks @jbaxleyiii!
ApolloClient.query
is currently configured to acceptWatchQueryOptions
, which means the docs show people that passing things likepollingInterval
intoApolloClient.query
is supported (when in reality it's only supported when usingApolloClient.watchQuery
). These changes add a newQueryOptions
interface, and pull some of the common options out into a parentQueryBaseOptions
interface.ApolloClient.query
has been updated to use theQueryOptions
interface, which should help clear up a bit of confusion.Fixes #3395.