Skip to content

Strict type checking, TypedDocumentNode and @apollo/client v3 #1062

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

Merged
merged 1 commit into from
Oct 18, 2020

Conversation

javiertury
Copy link
Contributor

@javiertury javiertury commented Sep 26, 2020

The main purpose of this PR is to use @apollo/client v3. The new cache management system is a huge improvement from v2.

I also noticed that strict was not enabled and therefore nullable types were inaccurate. The codebase is very clean, so migrating to strict was easy.

Finally, I saw that @apollo/client added support for TypedDocumentNode, which unifies document, query type and variable type into a single object. Naturally I couldn't resist adding support for this too.

  • esModuleInterop is needed for zen-observable, a dependency of @apollo/client
  • Cannot import directly from @apollo/client because it pulls react. We must import from @apollo/client/<subdir>.

@javiertury javiertury changed the title Strict type checking and @apollo/client v3 [vue-apollo-composable] Strict type checking and @apollo/client v3 Sep 26, 2020
@javiertury javiertury force-pushed the v4_strict_and_apollo_3 branch 5 times, most recently from f9c537b to 22ed24a Compare September 26, 2020 17:11
@javiertury javiertury changed the title [vue-apollo-composable] Strict type checking and @apollo/client v3 Strict type checking, TypedDocumentNode and @apollo/client v3 Sep 26, 2020
@javiertury
Copy link
Contributor Author

So after adding support for TypedDocumentNode I think this is PR is done, it brings vue on par with react.

@javiertury javiertury force-pushed the v4_strict_and_apollo_3 branch 2 times, most recently from bdb5adc to b006c2c Compare September 27, 2020 10:19
@alex7229
Copy link

Looking forward for this to be merged. I've encountered a small problem with current type for 'useQuery', where result is TResult and not 'TResult | undefined'. And it is fixed here

@Akryum
Copy link
Member

Akryum commented Oct 17, 2020

Hi! Could you please look at those conflicts? Thanks!

@javiertury javiertury force-pushed the v4_strict_and_apollo_3 branch 5 times, most recently from a67aef3 to aafdd21 Compare October 17, 2020 14:33
@javiertury
Copy link
Contributor Author

Sure, it should be ready now

@javiertury javiertury force-pushed the v4_strict_and_apollo_3 branch from aafdd21 to 044acf1 Compare October 17, 2020 20:41
@javiertury javiertury force-pushed the v4_strict_and_apollo_3 branch from 044acf1 to 0945347 Compare October 18, 2020 07:40
@Akryum Akryum merged commit fb1ab4d into vuejs:v4 Oct 18, 2020
@Akryum
Copy link
Member

Akryum commented Oct 18, 2020

Thanks for the huge useful PR! 😻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants