-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix: GraphIQL offline install #8153
Conversation
Thanks for opening this pull request!
|
Codecov ReportBase: 94.34% // Head: 87.40% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## alpha #8153 +/- ##
==========================================
- Coverage 94.34% 87.40% -6.94%
==========================================
Files 181 181
Lines 14388 14389 +1
==========================================
- Hits 13574 12577 -997
- Misses 814 1812 +998
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
From which version to which version was the change introduced?
What does that mean; is this is Node.js issue? |
@mtrezza sadly after a quick discussion with Laurin, the 2.6 version used a non-pinned version of GraphIQL via unpkg. So when they released a new version of GraphIQL Yoga on unpkg, all old versions are now broken... (like yoga 2.6). I agree it's a really bad way to fix the bug of unpinned version on unpkg, actually its breaking change on their side. On Parse side, now we will use the offline version (using the package). The damage is done now (maybe a too french expression), let's move on with this PR. I'm not also a huge fan of "always online" setups. I didn't check that graphIQL from yoga node was loaded via unpkg. Note: The parse dashboard is not affected by this issue. And users have workaround on their dev setup to use a local graphIQL ou playground app/webapp |
Sorry
This is a typo, now corrected |
Do you think we should provide more context in the changelog regarding this fix for developers? Which Parse Server versions are affected? |
There are multiple things that contributed to this problem:
We are aware that this is indeed a "breaking" change that occurred without really changing/releasing a new version for the The alternative to not breaking older versions of GraphQL Yoga would have been to NEVER again release a This "breaking" change occurred from
For people that can not upgrade, we recommend using patches/@graphql-yoga+common+2.6.0.patch diff --git a/node_modules/@graphql-yoga/common/index.js b/node_modules/@graphql-yoga/common/index.js
index 84d596a..57cb814 100644
--- a/node_modules/@graphql-yoga/common/index.js
+++ b/node_modules/@graphql-yoga/common/index.js
@@ -365,7 +365,7 @@ function useHealthCheck(options) {
};
}
-const graphiqlHTML = "<!doctype html><html lang=en><meta charset=utf-8><title>__TITLE__</title><link href=https://www.graphql-yoga.com/favicon.ico rel=icon><link href=https://unpkg.com/@graphql-yoga/graphiql/dist/style.css rel=stylesheet><body class=no-focus-outline id=body><noscript>You need to enable JavaScript to run this app.</noscript><div id=root></div><script type=module>import{renderYogaGraphiQL as r}from\"https://unpkg.com/@graphql-yoga/graphiql\";r(root,__OPTS__);</script>";
+const graphiqlHTML = "<!doctype html><html lang=en><meta charset=utf-8><title>__TITLE__</title><link href=https://www.graphql-yoga.com/favicon.ico rel=icon><link href=https://unpkg.com/@graphql-yoga/[email protected]/dist/style.css rel=stylesheet><body class=no-focus-outline id=body><noscript>You need to enable JavaScript to run this app.</noscript><div id=root></div><script type=module>import{renderYogaGraphiQL as r}from\"https://unpkg.com/@graphql-yoga/[email protected]\";r(root,__OPTS__);</script>";
function shouldRenderGraphiQL({ headers, method }) {
var _a;
diff --git a/node_modules/@graphql-yoga/common/index.mjs b/node_modules/@graphql-yoga/common/index.mjs
index 7258b6d..26cd3fc 100644
--- a/node_modules/@graphql-yoga/common/index.mjs
+++ b/node_modules/@graphql-yoga/common/index.mjs
@@ -363,7 +363,7 @@ function useHealthCheck(options) {
};
}
-const graphiqlHTML = "<!doctype html><html lang=en><meta charset=utf-8><title>__TITLE__</title><link href=https://www.graphql-yoga.com/favicon.ico rel=icon><link href=https://unpkg.com/@graphql-yoga/graphiql/dist/style.css rel=stylesheet><body class=no-focus-outline id=body><noscript>You need to enable JavaScript to run this app.</noscript><div id=root></div><script type=module>import{renderYogaGraphiQL as r}from\"https://unpkg.com/@graphql-yoga/graphiql\";r(root,__OPTS__);</script>";
+const graphiqlHTML = "<!doctype html><html lang=en><meta charset=utf-8><title>__TITLE__</title><link href=https://www.graphql-yoga.com/favicon.ico rel=icon><link href=https://unpkg.com/@graphql-yoga/[email protected]/dist/style.css rel=stylesheet><body class=no-focus-outline id=body><noscript>You need to enable JavaScript to run this app.</noscript><div id=root></div><script type=module>import{renderYogaGraphiQL as r}from\"https://unpkg.com/@graphql-yoga/[email protected]\";r(root,__OPTS__);</script>";
function shouldRenderGraphiQL({ headers, method }) {
var _a;
A full example for applying such a patch can be found here: https://github.com/n1ru4l/graphql-yoga-graphiql-incident-patch-package |
@Moumouls What does this PR mean for existing deployments? Is this a breaking change? |
Got it. The CI tells us that this PR requires to bump the node engine to >=14. We will only drop support for Node 12 with Parse Sever 6. So how should we proceed here? Is the Node 14 bump required in this PR? |
# Conflicts: # package.json
0bff06a
to
3980ef1
Compare
conflict fixed @mtrezza |
CI fails with:
If this PR requires at least Node 14 we can only merge this into Also, could you suggest a more descriptive PR title, which will be used as the changelog entry? A developer should be able to understand what this fix means. |
Hi @mtrezza if i fix the conflicts are we good to go to merge this one for Parse V6 ? |
I think so, I'll add this to the PS6 todo list |
maybe worth rebasing on top of #8250 ? |
# Conflicts: # package-lock.json # package.json
I will reformat the title to use the proper commit message syntax. |
@mtrezza i'm not sure i tried to npm i with node 16 and node 18, with lockfile V2 it seems that 16 and 18 try to reorder the lockfile. If you have an idea ? |
Could you try to revert any changes in
It seems these are the dependencies you want to install. Whatever changes in the lock file happen because of that, we can only accept I guess. It shouldn't cause any issues. |
okay it's better @mtrezza 🚀 thanks for your suggestions, i don't know what happened on my machine before |
Great, could you suggest a changelog entry that is descriptive enough for developers to understand what this fixes? |
@Moumouls Could you confirm that this isn't a breaking change, so we can release Parse Server 6 without this being merged? |
@mtrezza not a breaking change |
Thanks for confirming, I've removed it from the tracking list. |
New Pull Request Checklist
Issue Description
GraphQL Yoga GraphIQL used a always online strategy (using unpkg to load the graphql editor). But a change was introduced breaking current installation on yoga 2.6.
Now using graphql yoga in offline mode, using the package.
Related issue: NONE
Approach
Add yoga graphIQL package and also update yoga to last version.
TODOs before merging