{"_id":"@bota-apps/gql-client","_rev":"4-7ab1800528296aa6e6bd3d9f0729aa88","name":"@bota-apps/gql-client","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@bota-apps/gql-client","version":"0.2.0","author":{"name":"bota-apps"},"license":"MIT","_id":"@bota-apps/gql-client@0.2.0","maintainers":[{"name":"bota-apps","email":"imusema.hassen@icloud.com"}],"homepage":"https://github.com/bota-apps/bota-apps#readme","bugs":{"url":"https://github.com/bota-apps/bota-apps/issues"},"dist":{"shasum":"04e57d047f5970ac5378cb25a33fac3da509ae07","tarball":"https://registry.npmjs.org/@bota-apps/gql-client/-/gql-client-0.2.0.tgz","fileCount":6,"integrity":"sha512-yxmCVrNWQjC3541RyFWrku9UZqIowKHMU3rv/QEFsF++xjDQgGrtzeCIfVpGjZjQi9vozcrbn1zBWqlQlfEvZg==","signatures":[{"sig":"MEQCIGxT2K1WC5dQlwFhRd5xrZdz/Z3nIdlSo8XC2UjYnD3CAiATWhwrNm0D4MhSR9JUBRHCqche3ooa1BZQhc/JZqvYfA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4321},"main":"./dist/index.js","type":"module","_from":"file:bota-apps-gql-client-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc && node ../../scripts/fixExtensions.mjs","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"bota-apps","email":"imusema.hassen@icloud.com"},"_resolved":"/private/var/folders/wp/6cc4gkfd481b73439xdrv4wm0000gn/T/74b8d71a3b4d91ac219c30b4017ddaa0/bota-apps-gql-client-0.2.0.tgz","_integrity":"sha512-yxmCVrNWQjC3541RyFWrku9UZqIowKHMU3rv/QEFsF++xjDQgGrtzeCIfVpGjZjQi9vozcrbn1zBWqlQlfEvZg==","repository":{"url":"git+https://github.com/bota-apps/bota-apps.git","type":"git","directory":"packages/gql-client"},"_npmVersion":"10.9.8","description":"A tiny cookie-credentialed GraphQL client factory built on graphql-request. createGraphQLClient(endpoint) → a client whose every request carries the HttpOnly session cookie.","directories":{},"_nodeVersion":"22.23.1","dependencies":{"graphql":"^16.9.0","graphql-request":"^7.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/gql-client_0.2.0_1782838685201_0.24413389474355363","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@bota-apps/gql-client","version":"0.2.1","author":{"name":"bota-apps"},"license":"MIT","_id":"@bota-apps/gql-client@0.2.1","maintainers":[{"name":"bota-apps","email":"imusema.hassen@icloud.com"}],"homepage":"https://github.com/bota-apps/packages/tree/main/packages/gql-client#readme","bugs":{"url":"https://github.com/bota-apps/packages/issues"},"dist":{"shasum":"81cfc4d9fdad300440fb8015f34d3f3ef90c0d06","tarball":"https://registry.npmjs.org/@bota-apps/gql-client/-/gql-client-0.2.1.tgz","fileCount":7,"integrity":"sha512-u4uVY3AsK2nrjE1HfiDnilt4zsnGxEuXOqX/BXItX4LPtdaClVaICqNY2aedcj4srabi9auDaUpZeNPWcuZOZQ==","signatures":[{"sig":"MEQCIFSxI2faZpOYWb2obyVkuVFjL/Z25HQyiEBzJD0kzzdFAiBLJatNWztnoYdHBwVL+AOczCkiYAIInbzB3c6h1mAM6A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5401},"main":"./dist/index.js","type":"module","_from":"file:bota-apps-gql-client-0.2.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"rm -rf dist && tsc && node ../../scripts/fixExtensions.mjs","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4e5bfbe5-5049-4fb6-9003-cfb0b5b90e8e"}},"_resolved":"/tmp/b68b269f3f584f5543035a8222620178/bota-apps-gql-client-0.2.1.tgz","_integrity":"sha512-u4uVY3AsK2nrjE1HfiDnilt4zsnGxEuXOqX/BXItX4LPtdaClVaICqNY2aedcj4srabi9auDaUpZeNPWcuZOZQ==","repository":{"url":"git+https://github.com/bota-apps/packages.git","type":"git","directory":"packages/gql-client"},"_npmVersion":"11.18.0","description":"A tiny cookie-credentialed GraphQL client factory built on graphql-request. createGraphQLClient(endpoint) → a client whose every request carries the HttpOnly session cookie.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"graphql":"^16.9.0","graphql-request":"^7.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/gql-client_0.2.1_1783061247720_0.28472019843838536","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@bota-apps/gql-client","version":"0.2.2","keywords":["bota-apps","typescript","graphql","graphql-request","graphql-client","cookies","session-auth","spa"],"author":{"url":"https://github.com/bota-apps","name":"Bota Apps"},"license":"MIT","_id":"@bota-apps/gql-client@0.2.2","maintainers":[{"name":"bota-apps","email":"imusema.hassen@icloud.com"}],"homepage":"https://github.com/bota-apps/packages/tree/main/packages/gql-client#readme","bugs":{"url":"https://github.com/bota-apps/packages/issues"},"dist":{"shasum":"90577133f8249c1949d11bae7184abb6bdd60669","tarball":"https://registry.npmjs.org/@bota-apps/gql-client/-/gql-client-0.2.2.tgz","fileCount":7,"integrity":"sha512-bf4lk/CBGWFQndgwfFhD1d0RgFKr+rPT8gth8MKgzG94CAi5qMJR3XlonGKkHuvPjenxbHoeklKK+0Fn8J50VQ==","signatures":[{"sig":"MEUCIQDhsG2VLPlMlI6MpJEkHV92zjVrxcst5BuwtciFOkCDeAIgfmElTPYTzhUFEDU4ExWfvHSsilkVE1q+3nHOfoDXhZk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7280},"main":"./dist/index.js","type":"module","_from":"file:bota-apps-gql-client-0.2.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"rm -rf dist && tsc && node ../../scripts/fixExtensions.mjs","clean":"rm -rf dist","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c36d1886-f2b3-4211-8fc7-6e1adddcd461"}},"_resolved":"/tmp/6b7f1a2744d641f9f87c71d954e952cb/bota-apps-gql-client-0.2.2.tgz","_integrity":"sha512-bf4lk/CBGWFQndgwfFhD1d0RgFKr+rPT8gth8MKgzG94CAi5qMJR3XlonGKkHuvPjenxbHoeklKK+0Fn8J50VQ==","repository":{"url":"git+https://github.com/bota-apps/packages.git","type":"git","directory":"packages/gql-client"},"_npmVersion":"11.18.0","description":"A tiny cookie-credentialed GraphQL client factory built on graphql-request. createGraphQLClient(endpoint) → a client whose every request carries the HttpOnly session cookie.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"graphql":"^16.9.0","graphql-request":"^7.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/gql-client_0.2.2_1783319739804_0.382675277537216","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@bota-apps/gql-client","version":"0.3.0","description":"A tiny cookie-credentialed GraphQL client factory built on graphql-request. createGraphQLClient(endpoint) → a client whose every request carries the HttpOnly session cookie.","keywords":["bota-apps","typescript","graphql","graphql-request","graphql-client","cookies","session-auth","spa"],"license":"MIT","author":{"name":"Bota Apps","url":"https://github.com/bota-apps"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/bota-apps/packages.git","directory":"packages/gql-client"},"homepage":"https://github.com/bota-apps/packages/tree/main/packages/gql-client#readme","bugs":{"url":"https://github.com/bota-apps/packages/issues"},"publishConfig":{"access":"public"},"dependencies":{"graphql":"^16.9.0","graphql-request":"^7.1.2"},"devDependencies":{"typescript":"^5.8.3"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"build":"rm -rf dist && tsc && node ../../scripts/fixExtensions.mjs","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"_id":"@bota-apps/gql-client@0.3.0","_integrity":"sha512-S5NFnROZkkEk3tI9qlHX+hQFLK4/jCBl3UtqEO8pYPjLAgE3lKGxcmg5G9owan0FIcZcvmZla80ZoKrHNGKnJw==","_resolved":"/tmp/a3a2030e757eafc326134a5b70ff2a1b/bota-apps-gql-client-0.3.0.tgz","_from":"file:bota-apps-gql-client-0.3.0.tgz","_nodeVersion":"22.23.1","_npmVersion":"11.18.0","dist":{"integrity":"sha512-S5NFnROZkkEk3tI9qlHX+hQFLK4/jCBl3UtqEO8pYPjLAgE3lKGxcmg5G9owan0FIcZcvmZla80ZoKrHNGKnJw==","shasum":"3882644deaa3c75fe03906c14b256c1108b7f0f1","tarball":"https://registry.npmjs.org/@bota-apps/gql-client/-/gql-client-0.3.0.tgz","fileCount":11,"unpackedSize":17268,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bota-apps%2fgql-client@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDpo7hA+sL33XkUWvaXbUkwOB4hxbM0eiuCjPnWbbRYdQIgFxZhNWICpQszC6yE934VZm635eBiFRMEV/zWg9OQ9WQ="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c36d1886-f2b3-4211-8fc7-6e1adddcd461"}},"directories":{},"maintainers":[{"name":"bota-apps","email":"imusema.hassen@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gql-client_0.3.0_1784192820098_0.41223773350676884"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-30T16:58:05.097Z","modified":"2026-07-16T09:07:00.602Z","0.2.0":"2026-06-30T16:58:05.356Z","0.2.1":"2026-07-03T06:47:27.846Z","0.2.2":"2026-07-06T06:35:39.926Z","0.3.0":"2026-07-16T09:07:00.275Z"},"bugs":{"url":"https://github.com/bota-apps/packages/issues"},"author":{"name":"Bota Apps","url":"https://github.com/bota-apps"},"license":"MIT","homepage":"https://github.com/bota-apps/packages/tree/main/packages/gql-client#readme","keywords":["bota-apps","typescript","graphql","graphql-request","graphql-client","cookies","session-auth","spa"],"repository":{"type":"git","url":"git+https://github.com/bota-apps/packages.git","directory":"packages/gql-client"},"description":"A tiny cookie-credentialed GraphQL client factory built on graphql-request. createGraphQLClient(endpoint) → a client whose every request carries the HttpOnly session cookie.","maintainers":[{"name":"bota-apps","email":"imusema.hassen@icloud.com"}],"readme":"# @bota-apps/gql-client\n\nA tiny cookie-credentialed GraphQL client factory built on\n[`graphql-request`](https://github.com/jasonkuhrt/graphql-request).\n`createGraphQLClient(endpoint)` returns a client whose every request carries the\n`HttpOnly` session cookie — the SPA never reads or holds a token.\n\n## Install\n\n```bash\npnpm add @bota-apps/gql-client\n# depends on graphql + graphql-request (installed transitively)\n```\n\n## Usage\n\n```ts\nimport { createGraphQLClient, gql } from \"@bota-apps/gql-client\";\n\nconst client = createGraphQLClient(\"https://api.example.com/graphql\");\n\nconst data = await client.request(gql`\n  query Me {\n    me {\n      id\n      name\n    }\n  }\n`);\n```\n\n`createGraphQLClient(endpoint)` returns a `GraphQLClient` configured with\n`credentials: \"include\"`. That single option is the whole point of cookie-based\nauth: every request carries the `HttpOnly` session cookie the server set at\nlogin, so the SPA never reads, stores, or forwards a bearer token.\n\n### Endpoint must be absolute\n\n`endpoint` must be an **absolute** URL. `graphql-request` builds a\n`new URL(endpoint)` internally, which throws on a bare relative path such as\n`/graphql`. The URL comes straight from app config — this package stays\nplatform-agnostic and makes no assumptions about the host environment:\n\n```ts\nconst client = createGraphQLClient(appConfig.apiUrl); // e.g. graphqlAppEnv.apiUrl\n```\n\n### Typed documents\n\nThe returned value is a standard `graphql-request` `GraphQLClient`, so it works\nwith `TypedDocumentNode` documents (for example those emitted by\n[`@bota-apps/gql-codegen`](../gql-codegen)) for end-to-end type inference, and\ncomposes directly with the React Query pipelines in\n[`@bota-apps/hooks`](../hooks):\n\n```ts\nconst result = await client.request(EmployeesDocument); // fully typed\n```\n\n## API\n\n| Export                | What                                                                       |\n| --------------------- | -------------------------------------------------------------------------- |\n| `createGraphQLClient` | `(endpoint: string) => GraphQLClient` — cookie-credentialed client factory |\n| `gql`                 | Re-export of the `gql` template tag from `graphql-request`                 |\n| `GraphQLClient`       | Re-exported **type** from `graphql-request` for annotating client values   |\n\nPart of the [`@bota-apps` packages monorepo](https://github.com/bota-apps/packages).\n","readmeFilename":"README.md"}