{"id":13727233,"url":"https://github.com/Daniel15/urql-persisted-queries","last_synced_at":"2025-05-07T22:30:58.594Z","repository":{"id":139345680,"uuid":"190973176","full_name":"Daniel15/urql-persisted-queries","owner":"Daniel15","description":"urql exchange that implements Apollo-style Automatic Persisted Queries","archived":false,"fork":false,"pushed_at":"2020-04-10T15:33:08.000Z","size":222,"stargazers_count":27,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T15:52:35.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://d.sb/urql-pq","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/Daniel15.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-06-09T06:41:29.000Z","updated_at":"2023-05-06T14:15:16.000Z","dependencies_parsed_at":"2024-01-06T07:57:27.324Z","dependency_job_id":"b430642f-7a73-4564-bacf-353c683d2478","html_url":"https://github.com/Daniel15/urql-persisted-queries","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daniel15%2Furql-persisted-queries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daniel15%2Furql-persisted-queries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daniel15%2Furql-persisted-queries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daniel15%2Furql-persisted-queries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daniel15","download_url":"https://codeload.github.com/Daniel15/urql-persisted-queries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252965263,"owners_count":21832853,"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":[],"created_at":"2024-08-03T01:03:45.412Z","updated_at":"2025-05-07T22:30:58.000Z","avatar_url":"https://github.com/Daniel15.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# urql-persisted-queries\n\n`urql-persisted-queries` implements Apollo-style [Automatic Persisted Queries](https://www.apollographql.com/docs/apollo-server/features/apq/) in [urql](https://formidable.com/open-source/urql/). From the Apollo docs:\n\n\u003e Apollo Server implements Automatic Persisted Queries (APQ), a technique that greatly improves network performance for GraphQL with zero build-time configuration. A persisted query is a ID or hash that can be sent to the server instead of the entire GraphQL query string. This smaller signature reduces bandwidth utilization and speeds up client loading times. Persisted queries are especially nice paired with GET requests, enabling the browser cache and integration with a CDN.\n\u003e\n\u003e With Automatic Persisted Queries, the ID is a deterministic hash of the input query, so we don't need a complex build step to share the ID between clients and servers. If a server doesn't know about a given hash, the client can expand the query for it; Apollo Server caches that mapping.\n\nIn order to use this, your GraphQL server needs to be compatible with it.\n\n# Usage\n\nTo use `urql-persisted-queries`, you need to install it either via Yarn or npm:\n\n```sh\nyarn add urql-persisted-queries\n```\n\nThen in your JavaScript code, replace urql's regular `fetchExchange` with the `persistedFetchExchange`. For example:\n\n```javascript\nimport { createClient, Provider, dedupExchange, cacheExchange } from 'urql';\nimport { persistedFetchExchange } from 'urql-persisted-queries';\n// ...\nconst client = createClient({\n  url: 'http://localhost:3001/graphql',\n  exchanges: [dedupExchange, cacheExchange, persistedFetchExchange],\n});\n```\n\nA basic example project is included in the `example` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaniel15%2Furql-persisted-queries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDaniel15%2Furql-persisted-queries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDaniel15%2Furql-persisted-queries/lists"}