https://github.com/graphqland/http-graphql-playground
HTTP request for graphql-playground with standard Request and Response
https://github.com/graphqland/http-graphql-playground
graphql graphql-playground handler http request response
Last synced: 6 months ago
JSON representation
HTTP request for graphql-playground with standard Request and Response
- Host: GitHub
- URL: https://github.com/graphqland/http-graphql-playground
- Owner: graphqland
- License: mit
- Created: 2022-08-10T05:12:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-10T05:38:39.000Z (over 3 years ago)
- Last Synced: 2025-10-02T02:26:35.806Z (6 months ago)
- Topics: graphql, graphql-playground, handler, http, request, response
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-graphql-playground
[](https://deno.land/x/http_graphql_playground)
[](https://doc.deno.land/https/deno.land/x/http_graphql_playground/mod.ts)


HTTP request for `graphql-playground` with standard `Request` and `Response`
## Usage
- `createHandler` - Create HTTP request handler for `graphql-playground`.
- `validateRequest` - Validate the request is valid GraphQL playground request
or not.
```ts
import { createHandler } from "https://deno.land/x/http_graphql_playground@$VERSION/mod.ts";
import { serve } from "https://deno.land/std@$VERSION/http/mod.ts";
const handler = createHandler({
endpoint: "/graphql",
});
await serve(handler);
```
## Spec
The response includes the following response status codes and headers:
| Code | Content | Headers |
| :---: | :----------: | ---------------------- |
| `200` | `text/html` | `content-type`, `vary` |
| `405` | - | `allow` |
| `406` | `text/plain` | `content-type`, `vary` |
## License
Copyright © 2022-present [graphqland](https://github.com/graphqland).
Released under the [MIT](./LICENSE) license