Skip to content

Commit

Permalink
Allow for easier template overrides in graphiql (#863)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
benhowes and jkimbo committed Feb 7, 2020
1 parent f3f0608 commit 6b8c5bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion graphene_django/static/graphene_django/graphiql.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@
// Render <GraphiQL /> into the body.
ReactDOM.render(
React.createElement(GraphiQL, options),
document.body
document.getElementById("editor")
);
})();
3 changes: 2 additions & 1 deletion graphene_django/templates/graphene/graphiql.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<html>
<head>
<style>
html, body {
html, body, #editor {
height: 100%;
margin: 0;
overflow: hidden;
Expand All @@ -31,6 +31,7 @@
crossorigin="anonymous"></script>
</head>
<body>
<div id="editor"></div>
{% csrf_token %}
<script src="{% static 'graphene_django/graphiql.js' %}"></script>
</body>
Expand Down

0 comments on commit 6b8c5bd

Please sign in to comment.