-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from Ensembl/upgrade_ariadne
Upgrade Ariadne (Moving away from GraphQL Playground to GraphiQL2)
- Loading branch information
Showing
4 changed files
with
245 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<!-- | ||
* This Template is copied and overridden form | ||
* [venv]/ariadne/explorer/templates/graphiql.html | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui"> | ||
<title>{{ title }}</title> | ||
<style> | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
width: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
#graphiql { | ||
height: 100vh; | ||
} | ||
|
||
#graphiql-loading { | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
color: #545454; | ||
font-size: 1.5em; | ||
font-family: sans-serif; | ||
font-weight: bold; | ||
} | ||
|
||
#ensembl-header { | ||
background-color: #1b2c39; | ||
color: white; | ||
padding: 10px 30px 0px 22px; | ||
font-family: Lato, "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; | ||
font-weight: 400; | ||
height: 32px; | ||
align-items: center; | ||
} | ||
|
||
#ensembl-logo { | ||
box-sizing: border-box; | ||
color: white; | ||
fill: white; | ||
font-size: 13px; | ||
width: 100px; | ||
} | ||
|
||
#ensembl-copyright a { | ||
color: #09f; | ||
font-size: 12px; | ||
font-weight: 400; | ||
text-decoration: none; | ||
margin-left: 13px; | ||
} | ||
|
||
#ensembl-help { | ||
box-sizing: border-box; | ||
color: #09f; | ||
fill: white; | ||
font-size: 0px; | ||
width: 25px; | ||
float: right; | ||
} | ||
</style> | ||
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" /> | ||
{% if enable_explorer_plugin %} | ||
<link rel="stylesheet" href="https://unpkg.com/@graphiql/plugin-explorer/dist/style.css" /> | ||
{% endif %} | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="ensembl-header"> | ||
<a href="https://beta.ensembl.org" target="_blank" rel="noopener noreferrer"> | ||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 236 32" id="ensembl-logo"> | ||
<path d="M234.1 26.2v4.3h-24V1.4h4.5v24.8h19.5zM190.9 1.4c3.7 0 6.4.6 8.3 1.9 1.9 1.3 2.8 3.1 2.8 5.5 0 1.3-.4 2.5-1.1 3.5-.8 1-1.9 1.8-3.4 2.4 1.1.3 2.1.8 3 1.4.9.6 1.7 1.4 2.2 2.4.6 1 .9 2.2.9 3.5 0 1.7-.3 3.1-1 4.2s-1.6 2-2.7 2.6c-1.1.6-2.4 1.1-3.7 1.4-1.4.3-2.7.4-4.1.4h-17V1.4h15.8zm.4 4.4h-11.8v7.5h12.3c1 0 1.9-.2 2.8-.5.9-.3 1.5-.7 2.1-1.3.5-.6.8-1.3.8-2.1 0-1.3-.6-2.3-1.8-2.8-1.2-.6-2.7-.8-4.4-.8zm.7 11.8h-12.5v8.6h12.7c2 0 3.6-.4 4.9-1.1 1.3-.7 1.9-1.8 1.9-3.3 0-1.1-.4-2-1.1-2.6-.7-.6-1.6-1-2.7-1.3-1.1-.1-2.1-.3-3.2-.3zM138.4 1.4l11.5 15.5 11.5-15.5h4.4v29.2h-4.5V18.2c0-1.8 0-3.5.1-5.1s.2-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 3.3 1.3.7 2.9 1.1 4.9 1.1h12.8v4.3H12.9c-1.4 0-2.7-.1-4.1-.4s-2.6-.7-3.7-1.4c-1.1-.6-2-1.5-2.7-2.6s-1-2.5-1-4.2V1.4h24.1z"> | ||
</path> | ||
</svg> | ||
</a> | ||
<span style="margin-left: 13px">Core API (Beta)</span> | ||
<span id="ensembl-copyright"> | ||
<a href="https://www.ebi.ac.uk" target="_blank" rel="noopener noreferrer">© EMBL-EBI</a> | ||
</span> | ||
<span> | ||
<a href="https://beta.ensembl.org/help" target="_blank" rel="noopener noreferrer"> | ||
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 32 32" id="ensembl-help"> | ||
<path d="M19.635 26.895c0 2.368-1.895 4.105-4.106 4.105s-4.105-1.895-4.105-4.105 1.895-4.106 4.106-4.106 4.105 1.737 4.105 4.106zm6.316-17.21c0 6.63-7.106 6.63-7.106 9.157v.632c0 .631-.473 1.263-1.263 1.263h-4.579c-.631 0-1.263-.474-1.263-1.263v-.79c0-3.473 2.684-4.894 4.737-6 1.737-.947 2.842-1.579 2.842-2.842 0-1.737-2.21-2.842-3.947-2.842-2.369 0-3.316 1.105-4.737 2.842-.474.474-1.105.632-1.58.158L6.53 7.947c-.473-.473-.631-1.105-.315-1.579C8.582 2.895 11.582 1 16.16 1c4.737 0 9.79 3.79 9.79 8.684z"></path> | ||
</svg> | ||
</a> | ||
</span> | ||
</div> | ||
|
||
<div id="graphiql"> | ||
<div id="graphiql-loading">Loading {{ title }}...</div> | ||
</div> | ||
|
||
<script | ||
crossorigin | ||
src="https://unpkg.com/react@17/umd/react.development.js" | ||
></script> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" | ||
></script> | ||
|
||
<script | ||
crossorigin | ||
src="https://unpkg.com/graphiql/graphiql.min.js" | ||
></script> | ||
|
||
{% if enable_explorer_plugin %} | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/@graphiql/plugin-explorer/dist/graphiql-plugin-explorer.umd.js" | ||
></script> | ||
{% endif %} | ||
<script> | ||
var fetcher = GraphiQL.createFetcher({ | ||
url: window.location.href, | ||
}); | ||
|
||
function AriadneGraphiQL() { | ||
var [query, setQuery] = React.useState( | ||
'{% raw default_query %}', | ||
); | ||
{% if enable_explorer_plugin %} | ||
var explorerPlugin = GraphiQLPluginExplorer.useExplorerPlugin({ | ||
query: query, | ||
onEdit: setQuery, | ||
}); | ||
{% endif %} | ||
return React.createElement(GraphiQL, { | ||
fetcher: fetcher, | ||
defaultEditorToolsVisibility: true, | ||
{% if enable_explorer_plugin %} | ||
plugins: [explorerPlugin], | ||
{% endif %} | ||
query: query, | ||
onEditQuery: setQuery, | ||
}); | ||
} | ||
|
||
ReactDOM.render( | ||
React.createElement(AriadneGraphiQL), | ||
document.getElementById('graphiql'), | ||
); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters