forked from ethereum/go-ethereum
-
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.
graphql: upgrade UI to v2 (ethereum#27294)
Upgrades graphiql to v2.4.4. The interface has become much nicer, and there are extra features like tabs, history, dark mode etc. This change also now uses golang embed to bundle the resources. --------- Co-authored-by: Martin Holst Swende <[email protected]>
- Loading branch information
Showing
8 changed files
with
715 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package graphiql | ||
|
||
import ( | ||
"embed" | ||
) | ||
|
||
//go:embed *.js *.css *.html | ||
var Assets embed.FS |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
<!-- | ||
* Copyright (c) 2021 GraphQL Contributors | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
--> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>GraphiQL</title> | ||
<style> | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
width: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
#graphiql { | ||
height: 100vh; | ||
} | ||
</style> | ||
|
||
<script src="/graphql/ui/react.production.min.js"></script> | ||
<script src="/graphql/ui/react-dom.production.min.js"></script> | ||
|
||
<link rel="stylesheet" href="/graphql/ui/graphiql.min.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="graphiql">Loading...</div> | ||
<script src="/graphql/ui/graphiql.min.js" type="application/javascript"></script> | ||
<script> | ||
ReactDOM.render( | ||
React.createElement(GraphiQL, { | ||
fetcher: GraphiQL.createFetcher({ | ||
url: '/graphql', | ||
}), | ||
defaultEditorToolsVisibility: true, | ||
}), | ||
document.getElementById('graphiql'), | ||
); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.