Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

[@shopify/graphql-testing] upgrade @apollo/client and add props to GraphQL class #2708

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

markbann
Copy link
Contributor

@markbann markbann commented Jan 30, 2024

Description

Part of https://github.com/Shopify/banking-client/issues/2257

Summary

We faced a few different problems while attempting to integrate this library into the banking-client.

  1. jest warning of an open handle
    • This was caused by the ApolloClient in the GraphQL instance attempting to connect to dev tools by default
    • This is fixed by hardcoding connectToDevTools: false in graphql-controller.ts
  2. The errorPolicy of ApolloClient uses none by default
    • This is a mismatch between how our ApolloClient behaves in the our codebase
    • This is resolved by modifying the parameters of createGraphQLFactory to include an optional defaultOptions
  3. The graphql testing library is using an older version of @apollo/client
    • upgraded the dependency
    • other quilt libraries needed to be updated as they are used in tests

Question

Should this be a major version bump due to the @apollo/client upgrade?
I chose minor when making the changeset since I don't think the optional param or connectToDevTools: false with break anything, but consumers on lower versions of @apollo/client will be forced to upgrade.

@markbann markbann requested a review from a team as a code owner January 30, 2024 21:33
@markbann markbann requested a review from emiryy January 30, 2024 21:33
@markbann markbann force-pushed the mb/update/graphql-testing-factory branch from 872f2bc to 7982395 Compare January 30, 2024 21:56
@markbann markbann changed the title upgrade @apollo/client and add props to GraphQL class [@shopify/graphql-testing] upgrade @apollo/client and add props to GraphQL class Jan 30, 2024
@markbann markbann force-pushed the mb/update/graphql-testing-factory branch 4 times, most recently from ac1d1bf to 38fb7a9 Compare February 5, 2024 02:04
@markbann markbann force-pushed the mb/update/graphql-testing-factory branch from 38fb7a9 to cc41cf9 Compare February 26, 2024 18:56
@@ -31,7 +31,7 @@
"node": "^14.17.0 || >=16.0.0"
},
"dependencies": {
"@apollo/client": "^3.5.8",
"@apollo/client": "^3.8.10",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how web platform folks feel, but I think using peerDependencies for @apollo/client may be the way to go so that apps have more freedom to upgrade when they see fit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me. I was worried about potential side effects of updating this. I think peerDependencies makes takes away some risk.

@markbann markbann force-pushed the mb/update/graphql-testing-factory branch 3 times, most recently from c25c7b2 to 4876647 Compare February 26, 2024 21:44
@emiryy emiryy requested a review from vsumner February 27, 2024 21:30
"graphql": ">=14.5.0 <16.0.0",
"jest-matcher-utils": "^26.6.2"
},
"devDependencies": {
"graphql-typed": "^2.0.2"
},
"peerDependencies": {
"@apollo/client": ">=3.5.8 || <3.9.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit curious as to the <3.9.0. Why not <4.0.0? apollo is at 3.9.5 why wouldn't we want to support further?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested with 3.9.x so I didn't want to go too high. That said, I think it's reasonable to include everything up to the next major version.

Copy link
Collaborator

@vsumner vsumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think we could expand the peer range.

@markbann markbann force-pushed the mb/update/graphql-testing-factory branch from 4876647 to db7367f Compare February 28, 2024 18:24
@markbann markbann force-pushed the mb/update/graphql-testing-factory branch from db7367f to a224c11 Compare February 28, 2024 18:39
@markbann markbann merged commit a8d431f into main Feb 28, 2024
9 checks passed
@markbann markbann deleted the mb/update/graphql-testing-factory branch February 28, 2024 18:52
@shopify-shipit shopify-shipit bot temporarily deployed to production-gem July 5, 2024 16:32 Inactive
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.

4 participants