{"id":50351018,"url":"https://github.com/coatl-labs/gql","last_synced_at":"2026-05-29T21:01:08.981Z","repository":{"id":58587471,"uuid":"532614143","full_name":"coatl-labs/gql","owner":"coatl-labs","description":"A GraphQL client for Node.js (\u003e=18) and the browser.","archived":false,"fork":false,"pushed_at":"2022-12-02T18:31:56.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T04:55:14.353Z","etag":null,"topics":["browser","client","gql","graphql","http","nodejs","query"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coatl-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-04T17:49:10.000Z","updated_at":"2022-09-04T17:58:27.000Z","dependencies_parsed_at":"2023-01-23T08:45:17.768Z","dependency_job_id":null,"html_url":"https://github.com/coatl-labs/gql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coatl-labs/gql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatl-labs%2Fgql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatl-labs%2Fgql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatl-labs%2Fgql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatl-labs%2Fgql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coatl-labs","download_url":"https://codeload.github.com/coatl-labs/gql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatl-labs%2Fgql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["browser","client","gql","graphql","http","nodejs","query"],"created_at":"2026-05-29T21:00:50.220Z","updated_at":"2026-05-29T21:01:08.976Z","avatar_url":"https://github.com/coatl-labs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @coatl/gql\n\nA GraphQL client for Node.js and the browser.\n\n## Requirements\n\n- Node.js 18.0.0 or later (for Fetch API support)\n- Any browser with Fetch API support\n\n## Installation\n\n```bash\n# using npm\nnpm install @coatl/gql\n\n# using yarn\nyarn add @coatl/gql\n\n# using pnpm\npnpm add @coatl/gql\n```\n\n## Features\n\n- [x] Queries and mutations\n- [x] Variable interpolation\n- [x] Full type safety\n- [x] Fragments\n- [x] Subscriptions\n- [ ] File uploads (multipart/form-data)\n- [ ] Directives\n- [ ] Custom scalars\n\n## Usage\n\n### Implementing a client\n\n```ts\nimport { GQLClient } from '@coatl/gql'\n\nexport const client = new GQLClient('https://api.example.com/graphql', {\n  headers: {\n    Authorization: 'Bearer \u003ctoken\u003e'\n  }\n})\n```\n\n### Queries\n\n```ts\nimport { client } from './client'\n\ninterface User {\n  id: string\n  name: string\n  email: string\n}\n\nconst users = await client.query\u003cUser[]\u003e(`\n  users {\n    id\n    name\n    email\n  }\n`)\n\nconsole.log(users) // [...]\n```\n\n### Mutations\n\n```ts\nimport { client } from './client'\n\ninterface User {\n  id: string\n  name: string\n  email: string\n}\n\ninterface CreateUserInput {\n  name: string\n  email: string\n}\n\nconst userExist = await client.query\u003cUser\u003e(`\n  # check if the user already exists\n  user(email: $email) {\n    id\n  }\n`)\n\nif (userExist) {\n  throw new Error('User already exists')\n}\n\nconst variables = {\n  name: 'John Doe',\n  email: 'jhon@doe.com'\n}\n\nconst user = await client.mutation\u003cUser, CreateUserInput\u003e(\n  `\n  createUser(input: $input) {\n    id\n    name\n    email\n  }\n`,\n  variables\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatl-labs%2Fgql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoatl-labs%2Fgql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatl-labs%2Fgql/lists"}