Skip to content

Commit

Permalink
Add toolbar to graphiql
Browse files Browse the repository at this point in the history
  • Loading branch information
sogko committed Oct 2, 2015
1 parent 0312865 commit 835f80d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion static/js/app-graphiql.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ $(function (global) {

global.renderGraphiql = function (elem) {
// Render <GraphiQL /> into the body.
var toolbar = React.createElement(GraphiQL.Toolbar, {}, [
"Source available at ",
React.createElement("a", {
href: "https://github.com/sogko/golang-graphql-playground",
}, "github")
]);
React.render(
React.createElement(GraphiQL, {
fetcher: graphQLFetcher,
Expand All @@ -85,7 +91,7 @@ $(function (global) {
"# will appear in the pane to the right.\n\n" +
"query RebelsShipsQuery {\n rebels {\n name\n ships(first: 1) {\n edges {\n" +
" node {\n name \n }\n }\n }\n }\n}"
}),
}, toolbar),
elem
);
}
Expand Down

0 comments on commit 835f80d

Please sign in to comment.