Skip to content
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

Fix typescript issue with defaultOptions in constructor #3585

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

hwillson
Copy link
Member

When the new QueryBaseOptions and QueryOptions interfaces were created in
eb89b23, ModifiableWatchQueryOptions was replaced by QueryOptions when checking the query defaultOptions used in the Apollo Client constructor. Unfortunately, this introduced a small type check bug since the query property in QueryOptions is a mandatory property, whereas ModifiableWatchQueryOptions did not include this property. This commit replaces the use of QueryOptions with QueryBaseOptions when type checking query in defaultOptions, since QueryBaseOptions doesn't have a query property.

Fixes #3583.

When the new `QueryBaseOptions` and `QueryOptions` interfaces
were created in
eb89b23,
`ModifiableWatchQueryOptions` was replaced by `QueryOptions`
when checking the `query` `defaultOptions` used in the
Apollo Client constructor. Unfortunately, this introduced a
small type check bug since the `query` property in `QueryOptions`
is a mandatory property, whereas `ModifiableWatchQueryOptions`
did not include this property. This commit replaces the use of
`QueryOptions` with `QueryBaseOptions` when type checking
`query` in `defaultOptions`, since `QueryBaseOptions` doesn't
have a `query` property.

Fixes #3583.
@apollo-cla
Copy link

apollo-cla commented Jun 14, 2018

Warnings
⚠️

There are library changes, but not tests. That's OK as long as you're refactoring existing code

Generated by 🚫 dangerJS

@hwillson hwillson merged commit ae1ab82 into master Jun 14, 2018
@hwillson hwillson deleted the hwillson/default-options-fix branch June 14, 2018 02:05
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants