Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Fix <ApolloProvider/> typings #1319

Merged
merged 1 commit into from
Nov 6, 2017
Merged

Conversation

Madumo
Copy link
Contributor

@Madumo Madumo commented Nov 3, 2017

This fixes the typings of ApolloProvider.

Rather than using the Cache type, which is defined in the TypeScript lib.dom.d.ts declaration file, for the generic parameter to ProviderProps in the ApolloProvider class, it may be more appropriate to use any to let the type flow through when the client is created. It may also be less confusing if the generic type parameter was renamed to something like TCache in the ProviderProps interface definition so it's not confused with the Cache type.

I tested this change in the ApolloProvider.d.ts file and noticed the error went away and the client was properly typed as NormalizedCache when defining the cache as InMemoryCache.

Ref: #1299

@apollo-cla
Copy link

@Madumo: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@apollo-cla
Copy link

apollo-cla commented Nov 3, 2017

Warnings
⚠️

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

Generated by 🚫 dangerJS

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.

3 participants