-
Notifications
You must be signed in to change notification settings - Fork 162
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
Upgrade GraphiQL to 1.5.1 #649
Conversation
@boulc I remember about this PR. Too much work these days. |
Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
Co-authored-by: Ivan Maximov <sungam3r@yandex.ru>
I need some time to check. |
@boulc Thanks for the fix. I don't know JS. I roughly understood what was happening here. I have two questions after which I will be glad to merge. |
I had some issues with missing |
Looks good. @sungam3r all set? |
Codecov Report
@@ Coverage Diff @@
## master #649 +/- ##
==========================================
- Coverage 50.27% 50.27% -0.01%
==========================================
Files 68 68
Lines 1838 1842 +4
Branches 184 185 +1
==========================================
+ Hits 924 926 +2
- Misses 860 862 +2
Partials 54 54
Continue to review full report at Codecov.
|
Wait a minute. |
Context
The goal is to add support request headers in GraphiQL (discussed in #504).
Description
Request headers support has been added in recent versions of GraphiQL. Unfortunately, GraphiQL with extensions does not support it. As it wraps the GraphiQL component and masks the props, upgrading has no effect. There is not much activity on graphiql-with-extensions repo since some time now.
The current integration of GraphiQL has a broken support of subscription (see #544), due to the deprecation of
subscribe
function in apollographql/subscriptions-transport-ws#272. Also this dependency is still required though not maintained anymore until #492 is resolved. For the same reason, the current integration relies on graphiql-subscriptions-fetcher which is archived and not maintained anymore, also wrapping theGraphQLFetcher
and masking the additional options necessary to support request headers.Proposal
Upgrading GraphiQL to version 1.5.1: cshtml file is inspired from CDN example.
Adding an option to enable/disable GraphiQL with extensions:
ExplorerExtensionEnabled
, enabled by default for backward compatibility.Adding an option to enable/disable header editor:
HeaderEditorEnabled
, enable by default (same as in GraphiQL).Wrapping
subscriptionsFetcher
to pass additional option to support request headers editor.Downgrade subscriptions-transport-ws to version 0.8.2 to fix Subscriptions didnt work out of the box in current examples and readme.md #544.
Tests
Screenshot of side by side example of a mutation on the left leading to a working subscription on the right:
On the previous screenshot, the request headers editor is visible on the right and the authorization header is available in HTTP context when debugging: