-
-
Notifications
You must be signed in to change notification settings - Fork 566
Add option to configure CDN serving GraphiQL files #3826
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
Comments
@parth-paradkar it's not too difficult to update the GraphiQL template already, no? I fear that adding another config would make the template more complex for not much gain 😊 |
I see, no worries. Thanks! |
@patrick91 what do you think about vendoring dependencies with strawberry instead of relying on a cdn? |
@caspervk I think we thought about that, but each framework has it's own way to handle static files, I don't there's a nice way to handle them generically 🤔 |
Right, it's annoying because there are no static files - it's just a html string through |
How about something like def get_graphql_ide_html(
graphql_ide: Optional[GraphQL_IDE] = "graphiql",
) -> str:
here = pathlib.Path(__file__).parents[1]
if graphql_ide == "apollo-sandbox":
path = here / "static/apollo-sandbox.html"
elif graphql_ide == "pathfinder":
path = here / "static/pathfinder.html"
else:
path = here / "static/graphiql.html"
- return path.read_text(encoding="utf-8")
+ template = path.read_text(encoding="utf-8")
+
+ template = template.replace(
+ "{{ graphiql.min.css }}",
+ (here / "static/vendor/graphiql.min.css").read_text(encoding="utf-8"),
+ )
+ template = template.replace(
+ "{{ graphiql.min.js }}",
+ (here / "static/vendor/graphiql.min.js").read_text(encoding="utf-8"),
+ )
+
+ return template or is it too dumb 😅 |
Feature Request Type
Description
Can we add an option to override the default unkpg.com CDN serving the GraphiQL IDE? (given the recent issues)-
graphql/graphiql#3877
unpkg/unpkg#412
unpkg/unpkg#443
Users may want to use another CDN in such incidents.
The text was updated successfully, but these errors were encountered: