{"id":13700839,"url":"https://github.com/deno-libs/gql","last_synced_at":"2025-04-13T07:48:04.120Z","repository":{"id":41086608,"uuid":"347456681","full_name":"deno-libs/gql","owner":"deno-libs","description":"☁ Universal GraphQL HTTP middleware for Deno and Bun","archived":false,"fork":false,"pushed_at":"2025-02-06T15:57:15.000Z","size":236,"stargazers_count":197,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T07:47:57.373Z","etag":null,"topics":["bun","deno","graphql","graphql-api","graphql-server"],"latest_commit_sha":null,"homepage":"https://jsr.io/@deno-libs/gql","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deno-libs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit_test.ts","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"issuehunt":"talentlessguy","github":["talentlessguy"]}},"created_at":"2021-03-13T19:09:43.000Z","updated_at":"2025-04-03T08:52:31.000Z","dependencies_parsed_at":"2025-02-28T00:12:23.691Z","dependency_job_id":"1338bfdd-c4e6-4c83-905f-800d5a5dad4c","html_url":"https://github.com/deno-libs/gql","commit_stats":{"total_commits":147,"total_committers":6,"mean_commits":24.5,"dds":0.5306122448979591,"last_synced_commit":"ceb7ace468b009a3cc830851ce839e509963e113"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fgql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fgql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fgql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deno-libs%2Fgql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deno-libs","download_url":"https://codeload.github.com/deno-libs/gql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","deno","graphql","graphql-api","graphql-server"],"created_at":"2024-08-02T20:01:02.753Z","updated_at":"2025-04-13T07:48:04.077Z","avatar_url":"https://github.com/deno-libs.png","language":"TypeScript","funding_links":["https://issuehunt.io/r/talentlessguy","https://github.com/sponsors/talentlessguy"],"categories":["Implementations","TypeScript","Modules"],"sub_categories":["JavaScript/TypeScript","Web utils"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/deno-libs/gql/master/logo.png\" width=\"200px\" /\u003e\n  \u003cbr /\u003e\u003cbr /\u003e\n\n[![nest badge][nest-badge]](https://nest.land/package/gql)\n[![GitHub Workflow Status][gh-actions-img]][github-actions]\n[![Codecov][cov-badge]][cov] [![][docs-badge]][docs]\n[![][code-quality-img]][code-quality]\n\n\u003c/div\u003e\n\n# gql\n\nUniversal and spec-compliant [GraphQL](https://www.graphql.com/) HTTP middleware\nfor Deno and Bun. Based on [graphql-http](https://github.com/graphql/graphql-http).\n\n## Features\n\n- ✨ Works with `Deno.serve`, `Bun.serve` and [oak](https://github.com/oakserver/oak)\n- ⚡\n  [GraphQL Playground](https://github.com/graphql/graphql-playground/tree/master/packages/graphql-playground-html)\n  integration (via `graphiql: true`)\n\n## Get started\n\nThe simplest setup with `Deno.serve`:\n\n```ts\nimport { GraphQLHTTP } from 'jsr:@deno-libs/gql@3.0.1/mod.ts'\nimport { makeExecutableSchema } from 'npm:@graphql-tools/schema@10.0.3'\nimport { gql } from 'https://deno.land/x/graphql_tag@0.1.2/mod.ts'\n\nconst typeDefs = gql`\n  type Query {\n    hello: String\n  }\n`\n\nconst resolvers = {\n  Query: {\n    hello: () =\u003e `Hello World!`,\n  },\n}\n\nconst schema = makeExecutableSchema({ resolvers, typeDefs })\n\nDeno.serve({\n  port: 3000,\n  onListen({ hostname, port }) {\n    console.log(`☁  Started on http://${hostname}:${port}`)\n  },\n}, async (req) =\u003e {\n  const { pathname } = new URL(req.url)\n  return pathname === '/graphql'\n    ? await GraphQLHTTP\u003cRequest\u003e({\n      schema,\n      graphiql: true,\n    })(req)\n    : new Response('Not Found', { status: 404 })\n})\n```\n\nThen run:\n\n```sh\n$ curl -X POST localhost:3000/graphql -d '{ \"query\": \"{ hello }\" }' -H \"Content-Type: application/json\"\n{\n  \"data\": {\n    \"hello\": \"Hello World!\"\n  }\n}\n```\n\nOr in the GraphQL Playground:\n\n![image](https://user-images.githubusercontent.com/35937217/112218821-4133c800-8c35-11eb-984a-5c21fa71c229.png)\n\n[docs-badge]: https://img.shields.io/github/v/release/deno-libs/gql?label=Docs\u0026logo=deno\u0026style=for-the-badge\u0026color=DD3FAA\n[docs]: https://doc.deno.land/https/deno.land/x/gql/mod.ts\n[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/deno-libs/gql/main.yml?branch=master\u0026style=for-the-badge\u0026logo=github\u0026label=\u0026color=DD3FAA\u0026\n[github-actions]: https://github.com/deno-libs/gql/actions\n[cov]: https://coveralls.io/github/deno-libs/gql\n[cov-badge]: https://img.shields.io/coveralls/github/deno-libs/gql?style=for-the-badge\u0026color=DD3FAA\n[nest-badge]: https://img.shields.io/badge/publushed%20on-nest.land-DD3FAA?style=for-the-badge\n[code-quality-img]: https://img.shields.io/codefactor/grade/github/deno-libs/gql?style=for-the-badge\u0026color=DD3FAA\n[code-quality]: https://www.codefactor.io/repository/github/deno-libs/gql\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeno-libs%2Fgql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeno-libs%2Fgql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeno-libs%2Fgql/lists"}