Skip to content

Commit 6b8c5bd

Browse files
benhowesjkimbo
andauthored
Allow for easier template overrides in graphiql (#863)
* don't replace <body> * Update graphene_django/templates/graphene/graphiql.html Co-Authored-By: Jonathan Kim <jkimbo@gmail.com> * Fix editor styling and initialisation Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
1 parent f3f0608 commit 6b8c5bd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

graphene_django/static/graphene_django/graphiql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@
9797
// Render <GraphiQL /> into the body.
9898
ReactDOM.render(
9999
React.createElement(GraphiQL, options),
100-
document.body
100+
document.getElementById("editor")
101101
);
102102
})();

graphene_django/templates/graphene/graphiql.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<html>
1111
<head>
1212
<style>
13-
html, body {
13+
html, body, #editor {
1414
height: 100%;
1515
margin: 0;
1616
overflow: hidden;
@@ -31,6 +31,7 @@
3131
crossorigin="anonymous"></script>
3232
</head>
3333
<body>
34+
<div id="editor"></div>
3435
{% csrf_token %}
3536
<script src="{% static 'graphene_django/graphiql.js' %}"></script>
3637
</body>

0 commit comments

Comments
 (0)