{"name":"@playlive/tiltify-graphql","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.4":{"name":"@playlive/tiltify-graphql","version":"0.1.4","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./errors":{"import":"./errors.js","types":"./errors.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-xX2p4+Zmky3JJfFtgDp61KsbCFo16b/7FWtIPTI3JW3RHb7kvfe0T13En2sC1usvgP7QkGTtciD5JdqLtF6iyA==","shasum":"20f6bbb45bbf4945797c2998684482d50ff2990b","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies — uses native `fetch`.\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                              | Description                                                                  |\n| ------------------------------------ | ---------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`          | Default barrel — re-exports everything below.                                |\n| `@playlive/tiltify-graphql/client`   | Just the `TiltifyGraphQL` class.                                             |\n| `@playlive/tiltify-graphql/queries`  | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients. |\n| `@playlive/tiltify-graphql/types`    | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).           |\n| `@playlive/tiltify-graphql/constants`| `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                              |\n\n## API reference\n\nRun `bun run docs:build` inside this package to emit the TypeDoc site at\n`dist/docs/`. The aggregate site (every package merged) is built via\n`bun run docs:site` at the workspace root.\n\nTop-level exports:\n\n| Export                            | Source        | Notes                                              |\n| --------------------------------- | ------------- | -------------------------------------------------- |\n| `TiltifyGraphQL`                  | `./client`    | The curated GraphQL client class.                  |\n| `GET_*_QUERY` constants           | `./queries`   | One per operation; safe to use with any client.    |\n| `TiltifyCauseDetail` + 20 others  | `./types`     | Full Tiltify GraphQL schema subset.                |\n| `DEFAULT_GRAPHQL_URL`             | `./constants` | `https://api.tiltify.com/`.                        |\n| `DEFAULT_CLIENT_LIBRARY`          | `./constants` | Apollo `extensions.clientLibrary` header default.  |\n| `KNOWN_URLS`                      | `./`          | Twitch Extension URL disclosure list.              |\n| `PACKAGE_NAME`                    | `./`          | Identifier for runtime version-pinning.            |\n\n## Upstream spec\n\nTiltify does not publish an OpenAPI spec for its GraphQL endpoint. The\noperation set here mirrors what `tiltify.com` itself sends — see\n`packages/tiltify/graphql/src/queries.ts` for the full query bodies. When\nTiltify ships a schema change, update the affected query string + types in\nlock-step and add a row to the root [`MIGRATION.md`](../../../MIGRATION.md).\n\nTiltify v5 REST OpenAPI snapshots (for the parallel REST surface in\n`@playlive/tiltify-core`) live at [`specs/tiltify/`](../../../specs/tiltify/).\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch. See [`docs/twitch-extension-checklist.md`](../../../docs/twitch-extension-checklist.md).\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\nSee the root [`MIGRATION.md`](../../../MIGRATION.md) for the full per-symbol\ntable.\n\n## Examples\n\nRealistic end-to-end scenarios (cause → leaderboards → donation feed) land\nin `examples/` once `dev/greenroom` (phase 8) is wired up as the harness.\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../../CONTRIBUTING.md). For adding new GraphQL\noperations:\n\n1. Add the query string to `src/queries.ts`.\n2. Add response types to `src/types.ts`.\n3. Add the wrapper method to `src/client.ts` with full TSDoc.\n4. Add unit tests under `tests/unit/`.\n5. Append to the changelog + migration table.\n\n## License\n\nMIT — see [LICENSE](../../../LICENSE). Distributed via Play Live\nCodeArtifact (PRD §6).\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.4.tgz","shasum":"20f6bbb45bbf4945797c2998684482d50ff2990b","integrity":"sha512-xX2p4+Zmky3JJfFtgDp61KsbCFo16b/7FWtIPTI3JW3RHb7kvfe0T13En2sC1usvgP7QkGTtciD5JdqLtF6iyA=="}},"0.1.0":{"name":"@playlive/tiltify-graphql","version":"0.1.0","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-fYNZ+QSpEAAI6zbtTrCryIvheCcRMhnmYLJ0hYMMG18WRvJF19HP0GscvFfsSttYlhdf8lDsR5B5y/bbISXppQ==","shasum":"60ae4d96f37123637f6834b79f1188b9521a4246","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies — uses native `fetch`.\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactPublicId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                              | Description                                                                  |\n| ------------------------------------ | ---------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`          | Default barrel — re-exports everything below.                                |\n| `@playlive/tiltify-graphql/client`   | Just the `TiltifyGraphQL` class.                                             |\n| `@playlive/tiltify-graphql/queries`  | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients. |\n| `@playlive/tiltify-graphql/types`    | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).           |\n| `@playlive/tiltify-graphql/constants`| `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                              |\n\n## API reference\n\nRun `bun run docs:build` inside this package to emit the TypeDoc site at\n`dist/docs/`. The aggregate site (every package merged) is built via\n`bun run docs:site` at the workspace root.\n\nTop-level exports:\n\n| Export                            | Source        | Notes                                              |\n| --------------------------------- | ------------- | -------------------------------------------------- |\n| `TiltifyGraphQL`                  | `./client`    | The curated GraphQL client class.                  |\n| `GET_*_QUERY` constants           | `./queries`   | One per operation; safe to use with any client.    |\n| `TiltifyCauseDetail` + 20 others  | `./types`     | Full Tiltify GraphQL schema subset.                |\n| `DEFAULT_GRAPHQL_URL`             | `./constants` | `https://api.tiltify.com/`.                        |\n| `DEFAULT_CLIENT_LIBRARY`          | `./constants` | Apollo `extensions.clientLibrary` header default.  |\n| `KNOWN_URLS`                      | `./`          | Twitch Extension URL disclosure list.              |\n| `PACKAGE_NAME`                    | `./`          | Identifier for runtime version-pinning.            |\n\n## Upstream spec\n\nTiltify does not publish an OpenAPI spec for its GraphQL endpoint. The\noperation set here mirrors what `tiltify.com` itself sends — see\n`packages/tiltify/graphql/src/queries.ts` for the full query bodies. When\nTiltify ships a schema change, update the affected query string + types in\nlock-step and add a row to the root [`MIGRATION.md`](../../../MIGRATION.md).\n\nTiltify v5 REST OpenAPI snapshots (for the parallel REST surface in\n`@playlive/tiltify-core`) live at [`specs/tiltify/`](../../../specs/tiltify/).\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch. See [`docs/twitch-extension-checklist.md`](../../../docs/twitch-extension-checklist.md).\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\nSee the root [`MIGRATION.md`](../../../MIGRATION.md) for the full per-symbol\ntable.\n\n## Examples\n\nRealistic end-to-end scenarios (cause → leaderboards → donation feed) land\nin `examples/` once `dev/greenroom` (phase 8) is wired up as the harness.\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../../CONTRIBUTING.md). For adding new GraphQL\noperations:\n\n1. Add the query string to `src/queries.ts`.\n2. Add response types to `src/types.ts`.\n3. Add the wrapper method to `src/client.ts` with full TSDoc.\n4. Add unit tests under `tests/unit/`.\n5. Append to the changelog + migration table.\n\n## License\n\nMIT — see [LICENSE](../../../LICENSE). Distributed via Play Live\nCodeArtifact (PRD §6).\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.0.tgz","shasum":"60ae4d96f37123637f6834b79f1188b9521a4246","integrity":"sha512-fYNZ+QSpEAAI6zbtTrCryIvheCcRMhnmYLJ0hYMMG18WRvJF19HP0GscvFfsSttYlhdf8lDsR5B5y/bbISXppQ=="}},"0.1.1":{"name":"@playlive/tiltify-graphql","version":"0.1.1","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-wE/C9w88jnEDrtI8lvOuEwg/GVpycKQoAUkR79RVQ178EKApVU4ih/qvgy1jMEcLYBv/+t+IqU+BT+Q85uK+Fg==","shasum":"152c8b2ef4925a6b570025396bc80ddb3348d65e","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies — uses native `fetch`.\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactPublicId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                              | Description                                                                  |\n| ------------------------------------ | ---------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`          | Default barrel — re-exports everything below.                                |\n| `@playlive/tiltify-graphql/client`   | Just the `TiltifyGraphQL` class.                                             |\n| `@playlive/tiltify-graphql/queries`  | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients. |\n| `@playlive/tiltify-graphql/types`    | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).           |\n| `@playlive/tiltify-graphql/constants`| `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                              |\n\n## API reference\n\nRun `bun run docs:build` inside this package to emit the TypeDoc site at\n`dist/docs/`. The aggregate site (every package merged) is built via\n`bun run docs:site` at the workspace root.\n\nTop-level exports:\n\n| Export                            | Source        | Notes                                              |\n| --------------------------------- | ------------- | -------------------------------------------------- |\n| `TiltifyGraphQL`                  | `./client`    | The curated GraphQL client class.                  |\n| `GET_*_QUERY` constants           | `./queries`   | One per operation; safe to use with any client.    |\n| `TiltifyCauseDetail` + 20 others  | `./types`     | Full Tiltify GraphQL schema subset.                |\n| `DEFAULT_GRAPHQL_URL`             | `./constants` | `https://api.tiltify.com/`.                        |\n| `DEFAULT_CLIENT_LIBRARY`          | `./constants` | Apollo `extensions.clientLibrary` header default.  |\n| `KNOWN_URLS`                      | `./`          | Twitch Extension URL disclosure list.              |\n| `PACKAGE_NAME`                    | `./`          | Identifier for runtime version-pinning.            |\n\n## Upstream spec\n\nTiltify does not publish an OpenAPI spec for its GraphQL endpoint. The\noperation set here mirrors what `tiltify.com` itself sends — see\n`packages/tiltify/graphql/src/queries.ts` for the full query bodies. When\nTiltify ships a schema change, update the affected query string + types in\nlock-step and add a row to the root [`MIGRATION.md`](../../../MIGRATION.md).\n\nTiltify v5 REST OpenAPI snapshots (for the parallel REST surface in\n`@playlive/tiltify-core`) live at [`specs/tiltify/`](../../../specs/tiltify/).\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch. See [`docs/twitch-extension-checklist.md`](../../../docs/twitch-extension-checklist.md).\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\nSee the root [`MIGRATION.md`](../../../MIGRATION.md) for the full per-symbol\ntable.\n\n## Examples\n\nRealistic end-to-end scenarios (cause → leaderboards → donation feed) land\nin `examples/` once `dev/greenroom` (phase 8) is wired up as the harness.\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../../CONTRIBUTING.md). For adding new GraphQL\noperations:\n\n1. Add the query string to `src/queries.ts`.\n2. Add response types to `src/types.ts`.\n3. Add the wrapper method to `src/client.ts` with full TSDoc.\n4. Add unit tests under `tests/unit/`.\n5. Append to the changelog + migration table.\n\n## License\n\nMIT — see [LICENSE](../../../LICENSE). Distributed via Play Live\nCodeArtifact (PRD §6).\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.1.tgz","shasum":"152c8b2ef4925a6b570025396bc80ddb3348d65e","integrity":"sha512-wE/C9w88jnEDrtI8lvOuEwg/GVpycKQoAUkR79RVQ178EKApVU4ih/qvgy1jMEcLYBv/+t+IqU+BT+Q85uK+Fg=="}},"0.1.2":{"name":"@playlive/tiltify-graphql","version":"0.1.2","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-xjgRspOaIbzl5ATo4i5+YuqqKVuLQAgwY+3Fks5+lrZ6PYWm2TfFCUgL8tmiOMYHDbAWCAuqn4JIRzhxELMaCw==","shasum":"3e329e77f156b13610377573b2db5afc388b7120","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies — uses native `fetch`.\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                              | Description                                                                  |\n| ------------------------------------ | ---------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`          | Default barrel — re-exports everything below.                                |\n| `@playlive/tiltify-graphql/client`   | Just the `TiltifyGraphQL` class.                                             |\n| `@playlive/tiltify-graphql/queries`  | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients. |\n| `@playlive/tiltify-graphql/types`    | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).           |\n| `@playlive/tiltify-graphql/constants`| `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                              |\n\n## API reference\n\nRun `bun run docs:build` inside this package to emit the TypeDoc site at\n`dist/docs/`. The aggregate site (every package merged) is built via\n`bun run docs:site` at the workspace root.\n\nTop-level exports:\n\n| Export                            | Source        | Notes                                              |\n| --------------------------------- | ------------- | -------------------------------------------------- |\n| `TiltifyGraphQL`                  | `./client`    | The curated GraphQL client class.                  |\n| `GET_*_QUERY` constants           | `./queries`   | One per operation; safe to use with any client.    |\n| `TiltifyCauseDetail` + 20 others  | `./types`     | Full Tiltify GraphQL schema subset.                |\n| `DEFAULT_GRAPHQL_URL`             | `./constants` | `https://api.tiltify.com/`.                        |\n| `DEFAULT_CLIENT_LIBRARY`          | `./constants` | Apollo `extensions.clientLibrary` header default.  |\n| `KNOWN_URLS`                      | `./`          | Twitch Extension URL disclosure list.              |\n| `PACKAGE_NAME`                    | `./`          | Identifier for runtime version-pinning.            |\n\n## Upstream spec\n\nTiltify does not publish an OpenAPI spec for its GraphQL endpoint. The\noperation set here mirrors what `tiltify.com` itself sends — see\n`packages/tiltify/graphql/src/queries.ts` for the full query bodies. When\nTiltify ships a schema change, update the affected query string + types in\nlock-step and add a row to the root [`MIGRATION.md`](../../../MIGRATION.md).\n\nTiltify v5 REST OpenAPI snapshots (for the parallel REST surface in\n`@playlive/tiltify-core`) live at [`specs/tiltify/`](../../../specs/tiltify/).\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch. See [`docs/twitch-extension-checklist.md`](../../../docs/twitch-extension-checklist.md).\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\nSee the root [`MIGRATION.md`](../../../MIGRATION.md) for the full per-symbol\ntable.\n\n## Examples\n\nRealistic end-to-end scenarios (cause → leaderboards → donation feed) land\nin `examples/` once `dev/greenroom` (phase 8) is wired up as the harness.\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../../CONTRIBUTING.md). For adding new GraphQL\noperations:\n\n1. Add the query string to `src/queries.ts`.\n2. Add response types to `src/types.ts`.\n3. Add the wrapper method to `src/client.ts` with full TSDoc.\n4. Add unit tests under `tests/unit/`.\n5. Append to the changelog + migration table.\n\n## License\n\nMIT — see [LICENSE](../../../LICENSE). Distributed via Play Live\nCodeArtifact (PRD §6).\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.2.tgz","shasum":"3e329e77f156b13610377573b2db5afc388b7120","integrity":"sha512-xjgRspOaIbzl5ATo4i5+YuqqKVuLQAgwY+3Fks5+lrZ6PYWm2TfFCUgL8tmiOMYHDbAWCAuqn4JIRzhxELMaCw=="}},"0.1.3":{"name":"@playlive/tiltify-graphql","version":"0.1.3","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./errors":{"import":"./errors.js","types":"./errors.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-f28hgrD/GT7b5QULQhcvS44ki9PalkaRV7FDYnYI/zVCACxRn30x+D3EQR/0dF+80DcJwLsdoRCp2ZI3laKm2A==","shasum":"57f95b8bdfd2a7feba0ea77806d77abef80e44d5","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies — uses native `fetch`.\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                              | Description                                                                  |\n| ------------------------------------ | ---------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`          | Default barrel — re-exports everything below.                                |\n| `@playlive/tiltify-graphql/client`   | Just the `TiltifyGraphQL` class.                                             |\n| `@playlive/tiltify-graphql/queries`  | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients. |\n| `@playlive/tiltify-graphql/types`    | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).           |\n| `@playlive/tiltify-graphql/constants`| `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                              |\n\n## API reference\n\nRun `bun run docs:build` inside this package to emit the TypeDoc site at\n`dist/docs/`. The aggregate site (every package merged) is built via\n`bun run docs:site` at the workspace root.\n\nTop-level exports:\n\n| Export                            | Source        | Notes                                              |\n| --------------------------------- | ------------- | -------------------------------------------------- |\n| `TiltifyGraphQL`                  | `./client`    | The curated GraphQL client class.                  |\n| `GET_*_QUERY` constants           | `./queries`   | One per operation; safe to use with any client.    |\n| `TiltifyCauseDetail` + 20 others  | `./types`     | Full Tiltify GraphQL schema subset.                |\n| `DEFAULT_GRAPHQL_URL`             | `./constants` | `https://api.tiltify.com/`.                        |\n| `DEFAULT_CLIENT_LIBRARY`          | `./constants` | Apollo `extensions.clientLibrary` header default.  |\n| `KNOWN_URLS`                      | `./`          | Twitch Extension URL disclosure list.              |\n| `PACKAGE_NAME`                    | `./`          | Identifier for runtime version-pinning.            |\n\n## Upstream spec\n\nTiltify does not publish an OpenAPI spec for its GraphQL endpoint. The\noperation set here mirrors what `tiltify.com` itself sends — see\n`packages/tiltify/graphql/src/queries.ts` for the full query bodies. When\nTiltify ships a schema change, update the affected query string + types in\nlock-step and add a row to the root [`MIGRATION.md`](../../../MIGRATION.md).\n\nTiltify v5 REST OpenAPI snapshots (for the parallel REST surface in\n`@playlive/tiltify-core`) live at [`specs/tiltify/`](../../../specs/tiltify/).\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch. See [`docs/twitch-extension-checklist.md`](../../../docs/twitch-extension-checklist.md).\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\nSee the root [`MIGRATION.md`](../../../MIGRATION.md) for the full per-symbol\ntable.\n\n## Examples\n\nRealistic end-to-end scenarios (cause → leaderboards → donation feed) land\nin `examples/` once `dev/greenroom` (phase 8) is wired up as the harness.\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../../CONTRIBUTING.md). For adding new GraphQL\noperations:\n\n1. Add the query string to `src/queries.ts`.\n2. Add response types to `src/types.ts`.\n3. Add the wrapper method to `src/client.ts` with full TSDoc.\n4. Add unit tests under `tests/unit/`.\n5. Append to the changelog + migration table.\n\n## License\n\nMIT — see [LICENSE](../../../LICENSE). Distributed via Play Live\nCodeArtifact (PRD §6).\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.3.tgz","shasum":"57f95b8bdfd2a7feba0ea77806d77abef80e44d5","integrity":"sha512-f28hgrD/GT7b5QULQhcvS44ki9PalkaRV7FDYnYI/zVCACxRn30x+D3EQR/0dF+80DcJwLsdoRCp2ZI3laKm2A=="}},"0.1.5":{"name":"@playlive/tiltify-graphql","version":"0.1.5","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./errors":{"import":"./errors.js","types":"./errors.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-GO/zfd/jjS9pzseCoV5CnmIinhUWLPh24pYSMy7nAqxg57ksJLwMF1skRGWLBoVRkNBalycCzxUJMlmeNkt56w==","shasum":"1c60589553029a1c2e153fe7a039f4bca17bfc85","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies and no runtime dependencies — `peerDependencies` in\n`package.json` is empty and the client uses the platform's `fetch` (injectable\nvia the constructor's `options.fetch`).\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                               | Description                                                                   |\n| ------------------------------------- | ----------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`           | Default barrel — re-exports everything below.                                  |\n| `@playlive/tiltify-graphql/client`    | Just the `TiltifyGraphQL` class.                                               |\n| `@playlive/tiltify-graphql/errors`    | `TiltifyGraphQLError` + `isTiltifyGraphQLError` (no client, no queries).        |\n| `@playlive/tiltify-graphql/queries`   | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients.   |\n| `@playlive/tiltify-graphql/types`     | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).             |\n| `@playlive/tiltify-graphql/constants` | `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                               |\n\n## API reference\n\nRun `bun run docs:build` inside this package to emit the TypeDoc site at\n`dist/docs/`. The aggregate site (every package merged) is built via\n`bun run docs:site` at the workspace root.\n\nTop-level exports:\n\n| Export                                                   | Source        | Kind      | Notes                                                                |\n| -------------------------------------------------------- | ------------- | --------- | -------------------------------------------------------------------- |\n| `TiltifyGraphQL`                                          | `./client`    | class     | The curated GraphQL client.                                           |\n| `TiltifyGraphQLError`                                     | `./errors`    | class     | Thrown by every method. Carries `operationName`, `errors[]`, `status`, `isNotFound`. |\n| `isTiltifyGraphQLError`                                   | `./errors`    | function  | Realm-safe type guard — prefer over `instanceof` across bundles.       |\n| `TiltifyGraphQLErrorEntry`, `TiltifyGraphQLErrorOptions`  | `./errors`    | type      | Raw `errors[]` entry shape + constructor options.                     |\n| `GET_*_QUERY` (14 constants)                              | `./queries`   | const     | One per operation; safe to use with any GraphQL client.               |\n| `TiltifyCauseDetail` + 34 other types                     | `./types`     | type      | The Tiltify GraphQL schema subset this package selects on.            |\n| `TiltifyGraphQLOptions`                                   | `./types`     | type      | Constructor options (`headers`, `fetch`, `clientLibrary`).            |\n| `DEFAULT_GRAPHQL_URL`                                     | `./constants` | const     | `\"https://api.tiltify.com/\"`.                                         |\n| `DEFAULT_CLIENT_LIBRARY`                                  | `./constants` | const     | Apollo `extensions.clientLibrary` default (`@apollo/client` 4.1.6).   |\n| `KNOWN_URLS`                                              | `./`          | const     | Twitch Extension URL disclosure list.                                 |\n| `PACKAGE_NAME`                                            | `./`          | const     | Identifier for runtime version-pinning.                               |\n\n### `TiltifyGraphQL` methods\n\nEvery method returns the unwrapped `data` for its operation and throws\n`TiltifyGraphQLError` on failure. Methods documented as returning `| null`\nnormalize Tiltify's not-found signal (see [Error handling](#error-handling)).\n\n| Method                                                          | Returns                                                                   |\n| ---------------------------------------------------------------- | ------------------------------------------------------------------------- |\n| `query<TData, TVars>(operationName, query, variables?)`          | `TData` — low-level escape hatch for any operation.                        |\n| `getUserBySlug<TUser>(slug)`                                     | `TUser \\| null` (defaults to `TiltifyUser`).                               |\n| `getCauseBySlug(slug)`                                           | `TiltifyCauseDetail \\| null`                                               |\n| `getCauseAndFundraisingEventBySlug({ causeSlug, feSlug })`       | `{ cause, fundraisingEvent }` — each independently nullable.               |\n| `getCauseLeaderboards(slug)`                                     | `{ id, userLeaderboard, teamLeaderboard } \\| null`                         |\n| `getFundraisingEventLeaderboards(id)`                            | All six FE leaderboards, or `null`.                                        |\n| `getFactLeaderboards({ id, limit? })`                            | `{ id, donorLeaderboard, userLeaderboard, teamLeaderboard } \\| null`       |\n| `getFactFitnessLeaderboards({ id, limit? })`                     | Four fitness leaderboards, or `null`.                                      |\n| `getFactByVanityAndSlug({ vanity, slug? })`                      | `TiltifyFactVanitySlug \\| null` — resolves a URL to a fact id.             |\n| `getFactDonations({ id, limit, cursor? })`                       | `TiltifyDonationConnection \\| null` — one page, raw cursors.               |\n| `getAllFactDonations(id, pageSize?)`                             | `TiltifyDonationNode[]` — walks every page.                                |\n| `getFactTopDonation(id)`                                         | `TiltifyDonationNode \\| null`                                              |\n| `getFactMilestones(id)`                                          | `TiltifyMilestone[] \\| null`                                               |\n| `getCurrentMissions()`                                           | `TiltifyMission[]`                                                         |\n| `getLatestBadges()`                                              | `TiltifyLatestBadge[]`                                                     |\n| `getUserBadges(userId)`                                          | `TiltifyBadgeGroup[]`                                                      |\n\n## Upstream spec\n\nTiltify does not publish an OpenAPI spec for its GraphQL endpoint, and the\ngateway enforces a **server-side query-text whitelist** — you cannot send a\nslimmed-down variant of a whitelisted operation. The operation set here\ntherefore mirrors byte-for-byte what `tiltify.com` itself sends; the canonical\nstrings are snapshotted in\n[`tests/integration/canonical-queries.json`](./tests/integration/canonical-queries.json)\nand `bun run regen-queries:check` (part of the root `check:fast` gate) fails if\n[`src/queries.ts`](./src/queries.ts) drifts from that snapshot. Run\n`bun run regen-queries` to re-derive the module after refreshing the snapshot.\n\nWhen Tiltify ships a schema change, update the affected query string + types in\nlock-step and add a row to the root [`MIGRATION.md`](../../../MIGRATION.md).\n\nTiltify v5 REST OpenAPI snapshots (for the parallel REST surface in\n[`@playlive/tiltify-core`](../core/)) live at\n[`specs/tiltify/`](../../../specs/tiltify/).\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch. See [`docs/twitch-extension-checklist.md`](../../../docs/twitch-extension-checklist.md).\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\nSee the root [`MIGRATION.md`](../../../MIGRATION.md) for the full per-symbol\ntable.\n\n## Examples\n\n### Error handling\n\nTiltify signals \"no such resource\" as **HTTP 200** with\n`{\"errors\":[{\"message\":\"404\"}]}`, so the response status alone cannot tell a\nmissing fact from an outage. `TiltifyGraphQLError.isNotFound` pre-computes that\nclassification; `isTiltifyGraphQLError` is the realm-safe guard to reach for\nwhen bundler pre-bundling can produce two copies of the module.\n\n```ts\nimport { isTiltifyGraphQLError, TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\ntry {\n  const lb = await gql.getFundraisingEventLeaderboards(\"fe-does-not-exist\");\n  console.log(lb);\n} catch (err) {\n  if (isTiltifyGraphQLError(err)) {\n    if (err.isNotFound) {\n      console.info(\"no such fundraising event\");\n    } else {\n      // Log-safe projection: drops `cause` and raw `extensions` payloads.\n      console.error(\"tiltify graphql failed\", err.toJSON());\n      // → { name, message, operationName: \"get_fe_leaderboards\", status, isNotFound, errors: [...] }\n    }\n  } else {\n    throw err;\n  }\n}\n```\n\n### Resolve a landing-page URL, then read its milestones and top donors\n\nThe full path most overlays need: URL → fact id → fact-scoped data. Note that\n`getFactByVanityAndSlug` takes the vanity **without** its `@` / `+` sigil, and\nthat the fact id it returns is what every `getFact*` helper expects — not the\nFE's `publicId`.\n\n```ts\nimport {\n  TiltifyGraphQL,\n  type TiltifyLeaderboardEntry,\n  type TiltifyMilestone,\n} from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\nexport async function loadFundraisingEventPanel(vanity: string, slug: string): Promise<{\n  factId: string;\n  nextMilestone: TiltifyMilestone | null;\n  topDonors: TiltifyLeaderboardEntry[];\n  topDonationLabel: string;\n} | null> {\n  // 1. tiltify.com/@stjude/relay-for-st-jude-2026 → fact id\n  const fact = await gql.getFactByVanityAndSlug({ vanity, slug });\n  if (!fact) return null;\n\n  // 2. Fan out across fact-scoped operations.\n  const [milestones, leaderboards, top] = await Promise.all([\n    gql.getFactMilestones(fact.id),\n    gql.getFactLeaderboards({ id: fact.id, limit: 10 }),\n    gql.getFactTopDonation(fact.id),\n  ]);\n\n  // `active` flags the current \"next unhit\" milestone upstream.\n  const nextMilestone = milestones?.find((m) => m.active) ?? null;\n\n  // Leaderboards are Relay connections — unwrap edges → node.\n  const topDonors =\n    leaderboards?.donorLeaderboard?.entries.edges.map((edge) => edge.node) ?? [];\n\n  return {\n    factId: fact.id,\n    nextMilestone,\n    topDonors,\n    topDonationLabel: top ? `${top.donorName ?? \"Anonymous\"} — ${top.amount.value}` : \"—\",\n  };\n}\n```\n\n### Manual pagination and a custom `fetch`\n\n`getAllFactDonations` walks every page for you; drive `getFactDonations`\ndirectly when you want to stream or stop early. The constructor takes an\nendpoint override plus `headers` / `fetch` / `clientLibrary` — inject `fetch`\nto add caching, tracing, or a test double.\n\n```ts\nimport { TiltifyGraphQL, type TiltifyDonationNode } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL(\"https://api.tiltify.com/\", {\n  headers: { \"X-Source\": \"playlive-console\" },\n  fetch: (input, init) => {\n    console.debug(\"→ tiltify graphql\", input);\n    return globalThis.fetch(input, init);\n  },\n});\n\nexport async function* streamDonations(\n  factId: string,\n  pageSize = 100,\n): AsyncGenerator<TiltifyDonationNode> {\n  let cursor: string | null = null;\n\n  while (true) {\n    const page = await gql.getFactDonations({ id: factId, limit: pageSize, cursor });\n    if (!page) return;\n\n    for (const edge of page.edges) {\n      yield edge.node;\n    }\n\n    if (!page.pageInfo.hasNextPage || !page.pageInfo.endCursor) return;\n    cursor = page.pageInfo.endCursor;\n  }\n}\n```\n\nNeed an operation this client doesn't wrap? Pass one of the exported query\nstrings straight to `query` — it applies the same envelope, headers, and error\nclassification:\n\n```ts\nimport { GET_DEFAULT_TEMPLATE_FACT_QUERY } from \"@playlive/tiltify-graphql/queries\";\n\n// getFactMilestones() projects this payload down to `milestones`; go direct\n// when you also need polls, rewards, sponsors, or the template config.\nconst data = await gql.query<{ fact: Record<string, unknown> | null }, { id: string }>(\n  \"get_default_template_fact\",\n  GET_DEFAULT_TEMPLATE_FACT_QUERY,\n  { id: \"fact-id\" },\n);\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](../../../CONTRIBUTING.md). For adding new GraphQL\noperations:\n\n1. Add the query string to [`src/queries.ts`](./src/queries.ts) — and to\n   `tests/integration/canonical-queries.json`, since the gateway whitelists\n   query text.\n2. Add response types to [`src/types.ts`](./src/types.ts).\n3. Add the wrapper method to [`src/client.ts`](./src/client.ts) with full TSDoc.\n4. Add unit tests under [`tests/unit/`](./tests/unit/).\n5. Append to the [changelog](./CHANGELOG.md) + migration table.\n\n## License\n\nMIT — see [LICENSE](../../../LICENSE). Distributed via Play Live\nCodeArtifact (PRD §6).\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.5.tgz","shasum":"1c60589553029a1c2e153fe7a039f4bca17bfc85","integrity":"sha512-GO/zfd/jjS9pzseCoV5CnmIinhUWLPh24pYSMy7nAqxg57ksJLwMF1skRGWLBoVRkNBalycCzxUJMlmeNkt56w=="}},"0.1.6":{"name":"@playlive/tiltify-graphql","version":"0.1.6","description":"Curated GraphQL client for the public Tiltify GraphQL endpoint (api.tiltify.com).","type":"module","sideEffects":false,"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","types":"./index.d.ts"},"./client":{"import":"./client.js","types":"./client.d.ts"},"./errors":{"import":"./errors.js","types":"./errors.d.ts"},"./queries":{"import":"./queries.js","types":"./queries.d.ts"},"./types":{"import":"./types.js","types":"./types.d.ts"},"./constants":{"import":"./constants.js","types":"./constants.d.ts"}},"peerDependencies":{},"playlive":{"target":"browser","frontendEligible":true,"coverageFloor":85},"publishConfig":{"access":"restricted","registry":"https://playlive-767397689694.d.codeartifact.us-east-1.amazonaws.com/npm/playlive/"},"integrity":"sha512-UNv6aTktM087nQIrklTBHzFOyxBtgHpFtZjch4YFnQO+9dEoubbH0CI9UskykM3v1IH6NxHywg3eRUjV9GEfqw==","shasum":"943e671949925e6f6dc57278a0061ae4f8148b4d","readme":"# @playlive/tiltify-graphql\n\nCurated GraphQL client for the public Tiltify GraphQL endpoint\n(`https://api.tiltify.com/`). Ported from `@playlive/tiltify-tools`; the\nqueries, types, and wire format are preserved verbatim so consumers can\nmigrate by changing the import specifier alone.\n\n![Coverage](./coverage-badge.svg)\n\n## Install\n\n```bash\nbun add @playlive/tiltify-graphql\n```\n\nNo peer dependencies and no runtime dependencies — `peerDependencies` in\n`package.json` is empty and the client uses the platform's `fetch` (injectable\nvia the constructor's `options.fetch`).\n\n## Quick start\n\n```ts\nimport { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\n// Cause-level lookups\nconst cause = await gql.getCauseBySlug(\"stjude\");\nconst leaders = await gql.getCauseLeaderboards(\"stjude\");\n\n// Walk every donation on a fact\nconst all = await gql.getAllFactDonations(cause!.causeFactId, 100);\nconsole.log(`Total donations: ${all.length}`);\n\n// Resolve a tiltify.com URL to its fact id\nconst fact = await gql.getFactByVanityAndSlug({\n  vanity: \"ryantrahan\",\n  slug: \"50states\",\n});\n```\n\n## Subpath exports\n\n| Subpath                               | Description                                                                   |\n| ------------------------------------- | ----------------------------------------------------------------------------- |\n| `@playlive/tiltify-graphql`           | Default barrel — re-exports everything below.                                  |\n| `@playlive/tiltify-graphql/client`    | Just the `TiltifyGraphQL` class.                                               |\n| `@playlive/tiltify-graphql/errors`    | `TiltifyGraphQLError` + `isTiltifyGraphQLError` (no client, no queries).        |\n| `@playlive/tiltify-graphql/queries`   | Raw query strings (`GET_USER_BY_SLUG_QUERY` etc.) for use with other clients.   |\n| `@playlive/tiltify-graphql/types`     | Type-only barrel (`TiltifyCauseDetail`, `TiltifyDonationNode`, …).             |\n| `@playlive/tiltify-graphql/constants` | `DEFAULT_GRAPHQL_URL`, `DEFAULT_CLIENT_LIBRARY`.                               |\n\n## API reference\n\nFull generated API documentation:\n<https://packages.playlive.experience.stjude.org/p/@playlive/tiltify-graphql/docs/>\n\nTop-level exports:\n\n| Export                                                   | Source        | Kind      | Notes                                                                |\n| -------------------------------------------------------- | ------------- | --------- | -------------------------------------------------------------------- |\n| `TiltifyGraphQL`                                          | `./client`    | class     | The curated GraphQL client.                                           |\n| `TiltifyGraphQLError`                                     | `./errors`    | class     | Thrown by every method. Carries `operationName`, `errors[]`, `status`, `isNotFound`. |\n| `isTiltifyGraphQLError`                                   | `./errors`    | function  | Realm-safe type guard — prefer over `instanceof` across bundles.       |\n| `TiltifyGraphQLErrorEntry`, `TiltifyGraphQLErrorOptions`  | `./errors`    | type      | Raw `errors[]` entry shape + constructor options.                     |\n| `GET_*_QUERY` (14 constants)                              | `./queries`   | const     | One per operation; safe to use with any GraphQL client.               |\n| `TiltifyCauseDetail` + 34 other types                     | `./types`     | type      | The Tiltify GraphQL schema subset this package selects on.            |\n| `TiltifyGraphQLOptions`                                   | `./types`     | type      | Constructor options (`headers`, `fetch`, `clientLibrary`).            |\n| `DEFAULT_GRAPHQL_URL`                                     | `./constants` | const     | `\"https://api.tiltify.com/\"`.                                         |\n| `DEFAULT_CLIENT_LIBRARY`                                  | `./constants` | const     | Apollo `extensions.clientLibrary` default (`@apollo/client` 4.1.6).   |\n| `KNOWN_URLS`                                              | `./`          | const     | Twitch Extension URL disclosure list.                                 |\n| `PACKAGE_NAME`                                            | `./`          | const     | Identifier for runtime version-pinning.                               |\n\n### `TiltifyGraphQL` methods\n\nEvery method returns the unwrapped `data` for its operation and throws\n`TiltifyGraphQLError` on failure. Methods documented as returning `| null`\nnormalize Tiltify's not-found signal (see [Error handling](#error-handling)).\n\n| Method                                                          | Returns                                                                   |\n| ---------------------------------------------------------------- | ------------------------------------------------------------------------- |\n| `query<TData, TVars>(operationName, query, variables?)`          | `TData` — low-level escape hatch for any operation.                        |\n| `getUserBySlug<TUser>(slug)`                                     | `TUser \\| null` (defaults to `TiltifyUser`).                               |\n| `getCauseBySlug(slug)`                                           | `TiltifyCauseDetail \\| null`                                               |\n| `getCauseAndFundraisingEventBySlug({ causeSlug, feSlug })`       | `{ cause, fundraisingEvent }` — each independently nullable.               |\n| `getCauseLeaderboards(slug)`                                     | `{ id, userLeaderboard, teamLeaderboard } \\| null`                         |\n| `getFundraisingEventLeaderboards(id)`                            | All six FE leaderboards, or `null`.                                        |\n| `getFactLeaderboards({ id, limit? })`                            | `{ id, donorLeaderboard, userLeaderboard, teamLeaderboard } \\| null`       |\n| `getFactFitnessLeaderboards({ id, limit? })`                     | Four fitness leaderboards, or `null`.                                      |\n| `getFactByVanityAndSlug({ vanity, slug? })`                      | `TiltifyFactVanitySlug \\| null` — resolves a URL to a fact id.             |\n| `getFactDonations({ id, limit, cursor? })`                       | `TiltifyDonationConnection \\| null` — one page, raw cursors.               |\n| `getAllFactDonations(id, pageSize?)`                             | `TiltifyDonationNode[]` — walks every page.                                |\n| `getFactTopDonation(id)`                                         | `TiltifyDonationNode \\| null`                                              |\n| `getFactMilestones(id)`                                          | `TiltifyMilestone[] \\| null`                                               |\n| `getCurrentMissions()`                                           | `TiltifyMission[]`                                                         |\n| `getLatestBadges()`                                              | `TiltifyLatestBadge[]`                                                     |\n| `getUserBadges(userId)`                                          | `TiltifyBadgeGroup[]`                                                      |\n\n## Upstream spec\n\nThis package targets Tiltify's **public GraphQL endpoint** at\n`https://api.tiltify.com/` (`DEFAULT_GRAPHQL_URL`). Tiltify publishes no schema\nor introspection for it — the documented public surface is the v5 REST API at\n<https://developers.tiltify.com>, wrapped separately by\n[`@playlive/tiltify-core`](../core/).\n\nTwo consequences shape this client:\n\n- The gateway enforces a **server-side query-text whitelist**. You cannot send a\n  slimmed-down variant of a whitelisted operation, so the 14 exported\n  `GET_*_QUERY` strings mirror byte-for-byte what `tiltify.com` itself sends.\n  Use them verbatim (directly, or via the wrapper methods).\n- Response types describe the schema subset those operations select on. When\n  Tiltify ships a schema change, the query strings and types move in lock-step\n  and the package gets a new release — pin the version if you depend on exact\n  field sets.\n\n## Twitch Extension URL disclosure\n\nThe `KNOWN_URLS` export enumerates every absolute URL or host this package\ncan fetch — the list a Twitch Extension submission must disclose verbatim.\n\n```ts\nimport { KNOWN_URLS } from \"@playlive/tiltify-graphql\";\nconsole.log(KNOWN_URLS);\n// [\"https://api.tiltify.com\"]\n```\n\nKeep this list and the source export in sync — the Extension submission form\nrequires the disclosure list verbatim.\n\n## Migration from `@playlive/tiltify-tools`\n\n`@playlive/tiltify-graphql` is a drop-in replacement for the GraphQL surface\nthat used to live inside `tiltify-tools`. The `TiltifyGraphQL` class, every\nmethod signature, every exported type, and every query string constant are\npreserved unchanged. Only the import path moves:\n\n```diff\n- import { TiltifyGraphQL } from \"@playlive/tiltify-tools/tiltify-graphql\";\n+ import { TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n```\n\n## Examples\n\n### Error handling\n\nTiltify signals \"no such resource\" as **HTTP 200** with\n`{\"errors\":[{\"message\":\"404\"}]}`, so the response status alone cannot tell a\nmissing fact from an outage. `TiltifyGraphQLError.isNotFound` pre-computes that\nclassification; `isTiltifyGraphQLError` is the realm-safe guard to reach for\nwhen bundler pre-bundling can produce two copies of the module.\n\n```ts\nimport { isTiltifyGraphQLError, TiltifyGraphQL } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\ntry {\n  const lb = await gql.getFundraisingEventLeaderboards(\"fe-does-not-exist\");\n  console.log(lb);\n} catch (err) {\n  if (isTiltifyGraphQLError(err)) {\n    if (err.isNotFound) {\n      console.info(\"no such fundraising event\");\n    } else {\n      // Log-safe projection: drops `cause` and raw `extensions` payloads.\n      console.error(\"tiltify graphql failed\", err.toJSON());\n      // → { name, message, operationName: \"get_fe_leaderboards\", status, isNotFound, errors: [...] }\n    }\n  } else {\n    throw err;\n  }\n}\n```\n\n### Resolve a landing-page URL, then read its milestones and top donors\n\nThe full path most overlays need: URL → fact id → fact-scoped data. Note that\n`getFactByVanityAndSlug` takes the vanity **without** its `@` / `+` sigil, and\nthat the fact id it returns is what every `getFact*` helper expects — not the\nFE's `publicId`.\n\n```ts\nimport {\n  TiltifyGraphQL,\n  type TiltifyLeaderboardEntry,\n  type TiltifyMilestone,\n} from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL();\n\nexport async function loadFundraisingEventPanel(vanity: string, slug: string): Promise<{\n  factId: string;\n  nextMilestone: TiltifyMilestone | null;\n  topDonors: TiltifyLeaderboardEntry[];\n  topDonationLabel: string;\n} | null> {\n  // 1. tiltify.com/@stjude/relay-for-st-jude-2026 → fact id\n  const fact = await gql.getFactByVanityAndSlug({ vanity, slug });\n  if (!fact) return null;\n\n  // 2. Fan out across fact-scoped operations.\n  const [milestones, leaderboards, top] = await Promise.all([\n    gql.getFactMilestones(fact.id),\n    gql.getFactLeaderboards({ id: fact.id, limit: 10 }),\n    gql.getFactTopDonation(fact.id),\n  ]);\n\n  // `active` flags the current \"next unhit\" milestone upstream.\n  const nextMilestone = milestones?.find((m) => m.active) ?? null;\n\n  // Leaderboards are Relay connections — unwrap edges → node.\n  const topDonors =\n    leaderboards?.donorLeaderboard?.entries.edges.map((edge) => edge.node) ?? [];\n\n  return {\n    factId: fact.id,\n    nextMilestone,\n    topDonors,\n    topDonationLabel: top ? `${top.donorName ?? \"Anonymous\"} — ${top.amount.value}` : \"—\",\n  };\n}\n```\n\n### Manual pagination and a custom `fetch`\n\n`getAllFactDonations` walks every page for you; drive `getFactDonations`\ndirectly when you want to stream or stop early. The constructor takes an\nendpoint override plus `headers` / `fetch` / `clientLibrary` — inject `fetch`\nto add caching, tracing, or a test double.\n\n```ts\nimport { TiltifyGraphQL, type TiltifyDonationNode } from \"@playlive/tiltify-graphql\";\n\nconst gql = new TiltifyGraphQL(\"https://api.tiltify.com/\", {\n  headers: { \"X-Source\": \"playlive-console\" },\n  fetch: (input, init) => {\n    console.debug(\"→ tiltify graphql\", input);\n    return globalThis.fetch(input, init);\n  },\n});\n\nexport async function* streamDonations(\n  factId: string,\n  pageSize = 100,\n): AsyncGenerator<TiltifyDonationNode> {\n  let cursor: string | null = null;\n\n  while (true) {\n    const page = await gql.getFactDonations({ id: factId, limit: pageSize, cursor });\n    if (!page) return;\n\n    for (const edge of page.edges) {\n      yield edge.node;\n    }\n\n    if (!page.pageInfo.hasNextPage || !page.pageInfo.endCursor) return;\n    cursor = page.pageInfo.endCursor;\n  }\n}\n```\n\nNeed an operation this client doesn't wrap? Pass one of the exported query\nstrings straight to `query` — it applies the same envelope, headers, and error\nclassification:\n\n```ts\nimport { GET_DEFAULT_TEMPLATE_FACT_QUERY } from \"@playlive/tiltify-graphql/queries\";\n\n// getFactMilestones() projects this payload down to `milestones`; go direct\n// when you also need polls, rewards, sponsors, or the template config.\nconst data = await gql.query<{ fact: Record<string, unknown> | null }, { id: string }>(\n  \"get_default_template_fact\",\n  GET_DEFAULT_TEMPLATE_FACT_QUERY,\n  { id: \"fact-id\" },\n);\n```\n\n## License\n\nMIT © St. Jude Children's Research Hospital\n","readmeFilename":"README.md","dist":{"tarball":"https://packages.playlive.experience.stjude.org/@playlive/tiltify-graphql/-/tiltify-graphql-0.1.6.tgz","shasum":"943e671949925e6f6dc57278a0061ae4f8148b4d","integrity":"sha512-UNv6aTktM087nQIrklTBHzFOyxBtgHpFtZjch4YFnQO+9dEoubbH0CI9UskykM3v1IH6NxHywg3eRUjV9GEfqw=="}}},"time":{"0.1.4":"2026-08-26T18:10:09.998Z","modified":"2026-08-26T20:06:07.323Z","0.1.0":"2026-08-26T18:16:07.462Z","0.1.1":"2026-08-26T18:16:08.266Z","0.1.2":"2026-08-26T18:16:08.849Z","0.1.3":"2026-08-26T18:16:09.429Z","0.1.5":"2026-08-26T19:41:50.203Z","0.1.6":"2026-08-26T20:06:07.323Z"}}