{"id":30341589,"url":"https://github.com/productdevbookcom/urql-storage-capacitor","last_synced_at":"2025-08-18T09:19:52.445Z","repository":{"id":116072957,"uuid":"610097266","full_name":"productdevbookcom/urql-storage-capacitor","owner":"productdevbookcom","description":"Graphcache offline storage for Capacitor","archived":false,"fork":false,"pushed_at":"2025-08-04T23:02:00.000Z","size":2741,"stargazers_count":3,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-05T01:10:03.718Z","etag":null,"topics":["urql"],"latest_commit_sha":null,"homepage":"","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/productdevbookcom.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-06T04:39:45.000Z","updated_at":"2025-03-01T18:38:44.000Z","dependencies_parsed_at":"2023-11-01T03:32:54.702Z","dependency_job_id":"cfc8ef4b-1d7e-4fe1-82e9-757030efa602","html_url":"https://github.com/productdevbookcom/urql-storage-capacitor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"productdevbookcom/ts-bundle-template","purl":"pkg:github/productdevbookcom/urql-storage-capacitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/productdevbookcom%2Furql-storage-capacitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/productdevbookcom%2Furql-storage-capacitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/productdevbookcom%2Furql-storage-capacitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/productdevbookcom%2Furql-storage-capacitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/productdevbookcom","download_url":"https://codeload.github.com/productdevbookcom/urql-storage-capacitor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/productdevbookcom%2Furql-storage-capacitor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269814275,"owners_count":24479358,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":["urql"],"created_at":"2025-08-18T09:19:48.780Z","updated_at":"2025-08-18T09:19:52.433Z","avatar_url":"https://github.com/productdevbookcom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URQL Storage Capacitor\n\n![URQL Storage Capacitor](./.github/assets/urql-storage-capacitor.png)\n\n\n\u003cp\u003e\n      \u003ca href=\"https://www.npmjs.com/package/urql-storage-capacitor\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/urql-storage-capacitor.svg?style=flat\u0026colorA=002438\u0026colorB=28CF8D\" alt=\"Version\"\u003e\u003c/a\u003e\n      \u003ca href=\"https://www.npmjs.com/package/urql-storage-capacitor\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/urql-storage-capacitor.svg?style=flat\u0026colorA=002438\u0026colorB=28CF8D\" alt=\"Downloads\"\u003e\u003c/a\u003e\n      \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/productdevbookcom/urql-storage-capacitor.svg?style=flat\u0026colorA=002438\u0026colorB=28CF8D\" alt=\"License\"\u003e\u003c/a\u003e\n      \u003ca href=\"https://github.com/productdevbookcom/urql-storage-capacitor\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/stars/productdevbookcom/urql-storage-capacitor.svg?style=social\u0026label=Star\u0026maxAge=2592000\" alt=\"Github Stars\"\u003e \u003c/a\u003e\n\u003c/p\u003e\n\n\n## Installation\n\n```bash\npnpm install urql-storage-capacitor\n```\n\n`urql-storage-capacitor` is a Graphcache offline storage for Capacitor.\n\nIt is compatible for both plain Capacitor (including managed workflow), but it has a two peer dependencies - [Capacitor Preferences](https://capacitorjs.com/docs/apis/preferences) and [Capacitor Network](https://capacitorjs.com/docs/apis/network) - which must be installed separately. AsyncStorage will be used to persist the data, and NetInfo will be used to determine when the app is online and offline.\n\n## Quick Start Guide\n\nInstall Capacitor Preferences[https://capacitorjs.com/docs/apis/preferences] and Capacitor Network[https://capacitorjs.com/docs/apis/network] alongside `urql-storage-capacitor`:\n\nInstall `urql-storage-capacitor` alongside `urql` and `@urql/exchange-graphcache`:\n\n```sh\npnpm add urql-storage-capacitor\n# or \nyarn add urql-storage-capacitor\n# or\nnpm install --save urql-storage-capacitor\n```\n\nThen add it to the offline exchange:\n\n```js\nimport { createClient, dedupExchange, fetchExchange } from 'urql'\nimport { offlineExchange } from '@urql/exchange-graphcache'\nimport { makeAsyncStorage } from 'urql-storage-capacitor'\n\nconst storage = makeAsyncStorage({\n  dataKey: 'graphcache-data', // The AsyncStorage key used for the data (defaults to graphcache-data)\n  metadataKey: 'graphcache-metadata', // The AsyncStorage key used for the metadata (defaults to graphcache-metadata)\n  maxAge: 7, // How long to persist the data in storage (defaults to 7 days)\n})\n\nconst cache = offlineExchange({\n  schema,\n  storage,\n  updates: {\n    /* ... */\n  },\n  optimistic: {\n    /* ... */\n  },\n})\n\nconst client = createClient({\n  url: 'http://localhost:3000/graphql',\n  exchanges: [dedupExchange, cache, fetchExchange],\n})\n```\n\n# Inspiration\n\nThis project is inspired by [@urql/storage-rn](https://github.com/urql-graphql/urql/tree/main/packages/storage-rn)\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproductdevbookcom%2Furql-storage-capacitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproductdevbookcom%2Furql-storage-capacitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproductdevbookcom%2Furql-storage-capacitor/lists"}