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

chore: inline graphql-anywhere #301

Merged
merged 10 commits into from
Oct 26, 2022
Merged

chore: inline graphql-anywhere #301

merged 10 commits into from
Oct 26, 2022

Conversation

alessbell
Copy link
Member

In light of the deprecation of graphql-anywhere in the course of releasing Apollo Client 3 in 2020, this PR inlines the graphql function previously imported from graphql-anywhere/lib/async as well as types Resolver and ExecInfo and removes all other references to the deprecated library.

NB: graphql-anywhere@4.2.8 was published today with an updated peer dependency range for the graphql package to fix the npm i peer dependency error with graphql@16 for npm7+ (apollographql/apollo-client#10114), and to include a deprecation notice.

Feel free to close this PR in favor of continuing with graphql-anywhere now that the peer dependency issue is resolved, but thought I'd open it in case it's useful :) Thanks!

@alessbell
Copy link
Member Author

alessbell commented Oct 24, 2022

Note that bundle size also decreases with this PR:

Before (commit cde5f56)

CleanShot 2022-10-24 at 10 23 17

After (commit 26147d2)

CleanShot 2022-10-24 at 10 24 57

Copy link
Collaborator

@fbartho fbartho left a comment

Choose a reason for hiding this comment

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

This code looks pretty good! I haven't tested it yet myself, but do we see any reasons why this shouldn't merge?

README.md Outdated Show resolved Hide resolved
@alessbell
Copy link
Member Author

@fbartho thanks for the review 😄

All tests are passing:
CleanShot 2022-10-24 at 14 26 18

I also went through and updated the three examples so they build with the latest version of all dependencies, and so I could do a manual test against a local build of this PR. Everything looks good:

Simple

CleanShot 2022-10-24 at 13 57 04

Advanced

CleanShot 2022-10-24 at 14 07 34

TypeScript

CleanShot 2022-10-24 at 14 24 53

Reproduction Steps

If anyone wants to pull this PR and do the same, these are the reproduction steps:

  • pull PR branch
  • run npm i && npm run build
  • run cp package.json lib
  • run cd lib && npm pack
  • update the apollo-link-rest line inside the package.json of whichever example you're running to "apollo-link-rest": "file:../../lib/apollo-link-rest-0.9.0-rc.1.tgz",
  • npm i && npm start from inside the example's folder

README.md Show resolved Hide resolved
@alessbell
Copy link
Member Author

This is ready for a final pass 🙌

@alessbell
Copy link
Member Author

@fbartho just following up - I went ahead and updated the examples, but would be happy to move them to a separate PR if you prefer.

@fbartho
Copy link
Collaborator

fbartho commented Oct 26, 2022

No that's fine!

@fbartho fbartho added this to the v0.9.0 milestone Oct 26, 2022
@fbartho fbartho merged commit 9957569 into apollographql:master Oct 26, 2022
@alessbell alessbell deleted the inline-graphql-anywhere branch October 26, 2022 16:38
@fbartho
Copy link
Collaborator

fbartho commented Nov 15, 2022

Shipped this in v0.9.0! -- Enjoy! https://www.npmjs.com/package/apollo-link-rest/v/0.9.0

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.

2 participants