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

feat: createFetcher legacyClient option, simplify, docs #1819

Merged
merged 3 commits into from
Apr 3, 2021

Conversation

acao
Copy link
Member

@acao acao commented Mar 29, 2021

hopefully fixes #1800

  • createGraphiQLFetcher should have a legacyClient override option as has been noted by some users
  • createGraphiQLFetcher now only attempts an graphql-ws connection when only subscriptionsUrl is provided.
  • positive test coverage diff
  • document this new option
  • pass connectionParams with subscriptionsUrl
  • rename createGraphiQLFetcher to createFetcher as a breaking change?

@changeset-bot
Copy link

changeset-bot bot commented Mar 29, 2021

🦋 Changeset detected

Latest commit: 0f1d417

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@graphiql/toolkit Minor
graphiql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #1819 (aa238af) into main (3e2c9c8) will increase coverage by 0.03%.
The diff coverage is 83.33%.

❗ Current head aa238af differs from pull request most recent head 0f1d417. Consider uploading reports for the commit 0f1d417 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1819      +/-   ##
==========================================
+ Coverage   65.66%   65.70%   +0.03%     
==========================================
  Files          85       85              
  Lines        5115     5106       -9     
  Branches     1635     1631       -4     
==========================================
- Hits         3359     3355       -4     
+ Misses       1752     1747       -5     
  Partials        4        4              
Impacted Files Coverage Δ
...aphiql-toolkit/src/create-fetcher/createFetcher.ts 60.71% <50.00%> (ø)
...ackages/graphiql-toolkit/src/create-fetcher/lib.ts 59.57% <90.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e2c9c8...0f1d417. Read the comment docs.

@github-actions github-actions bot temporarily deployed to Deploy Preview March 29, 2021 04:38 Inactive
@acao
Copy link
Member Author

acao commented Mar 29, 2021

@junminstorage would this unblock you?

@junminstorage
Copy link

Yes, it does. having client to inject its own wsClient or legacyClient is great so createFetcher util can have the flexibility of not tied to any versions of clients if upgrades are needed.

@acao
Copy link
Member Author

acao commented Mar 30, 2021

@junminstorage should we specify peerDependency ranges and/or optionalDependencies do you think?

@junminstorage
Copy link

I am not super familiar with the difference between those two, it looks like peerDependency is better fit since the create-fetcher's lib.ts imports the two clients, and the legacy client is only used for type checking, so is it devDependency?

@acao
Copy link
Member Author

acao commented Apr 3, 2021

I am not super familiar with the difference between those two, it looks like peerDependency is better fit since the create-fetcher's lib.ts imports the two clients, and the legacy client is only used for type checking, so is it devDependency?

yes good thinking. the legacy client should be a devDependency, and then ws-client should be a peer dependency with ranges we support

@github-actions github-actions bot temporarily deployed to Deploy Preview April 3, 2021 16:41 Inactive
@acao acao merged commit dd9397e into main Apr 3, 2021
@acao acao deleted the feat/create-fetcher-legacy-client branch April 3, 2021 16:47
@github-actions github-actions bot mentioned this pull request Apr 3, 2021
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.

GraphiQL.createFetcher does not work for subscriptions-transport-ws
3 participants