Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GraphiQLPage = []byte(`
<!DOCTYPE html>
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/graphiql/0.11.11/graphiql.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.auto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.2.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.2.0/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/graphiql/0.11.11/graphiql.min.js"></script>
</head>
<body style="width: 100%; height: 100%; margin: 0; overflow: hidden;">
<div id="graphiql" style="height: 100vh;">Loading...</div>
<script>
function graphQLFetcher(graphQLParams) {
return fetch("/graphql", {
method: "post",
body: JSON.stringify(graphQLParams),
credentials: "include",
}).then(function (response) {
return response.text();
}).then(function (responseBody) {
try {
return JSON.parse(responseBody);
} catch (error) {
return responseBody;
}
});
}
ReactDOM.render(
React.createElement(GraphiQL, {fetcher: graphQLFetcher}),
document.getElementById("graphiql")
);
</script>
</body>
</html>
`)
Functions ¶
func DecodeCursor ¶
func EncodeCursor ¶
Types ¶
type GraphiQLHandler ¶
type GraphiQLHandler struct {
// contains filtered or unexported fields
}
func NewGraphiQLHandler ¶
func NewGraphiQLHandler(schema string) *GraphiQLHandler
func (*GraphiQLHandler) ServeHTTP ¶
func (t *GraphiQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LoggerHandler ¶
type LoggerHandler struct {
DebugMode bool
}
type PageInfoResolver ¶
type PageInfoResolver struct {
// contains filtered or unexported fields
}
func NewPageInfoResolver ¶
func NewPageInfoResolver(start, end *string, hasNext bool) *PageInfoResolver
func (*PageInfoResolver) EndCursor ¶
func (t *PageInfoResolver) EndCursor() *graphql.ID
func (*PageInfoResolver) HasNextPage ¶
func (t *PageInfoResolver) HasNextPage() bool
func (*PageInfoResolver) StartCursor ¶
func (t *PageInfoResolver) StartCursor() *graphql.ID
Click to show internal directories.
Click to hide internal directories.