{"id":17607298,"url":"https://github.com/usegraffy/graffy","last_synced_at":"2025-04-05T04:08:35.951Z","repository":{"id":34304375,"uuid":"142186412","full_name":"usegraffy/graffy","owner":"usegraffy","description":"Live queries for graph-shaped data","archived":false,"fork":false,"pushed_at":"2024-12-17T18:26:09.000Z","size":4851,"stargazers_count":45,"open_issues_count":14,"forks_count":8,"subscribers_count":0,"default_branch":"next","last_synced_at":"2025-03-27T13:44:05.693Z","etag":null,"topics":["data-fetching","falcor","graphql","nodejs","streaming-api"],"latest_commit_sha":null,"homepage":"https://graffy.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usegraffy.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}},"created_at":"2018-07-24T16:40:05.000Z","updated_at":"2024-12-17T18:23:55.000Z","dependencies_parsed_at":"2024-02-06T13:07:10.266Z","dependency_job_id":"eb2098a3-d2ee-4f40-91d0-568054610510","html_url":"https://github.com/usegraffy/graffy","commit_stats":{"total_commits":709,"total_committers":13,"mean_commits":54.53846153846154,"dds":0.2073342736248237,"last_synced_commit":"541ba9b80419d131e524d054f019adad2b07e037"},"previous_names":[],"tags_count":174,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usegraffy%2Fgraffy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usegraffy%2Fgraffy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usegraffy%2Fgraffy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usegraffy%2Fgraffy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usegraffy","download_url":"https://codeload.github.com/usegraffy/graffy/tar.gz/refs/heads/next","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284944,"owners_count":20913704,"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":["data-fetching","falcor","graphql","nodejs","streaming-api"],"created_at":"2024-10-22T16:09:42.416Z","updated_at":"2025-04-05T04:08:35.908Z","avatar_url":"https://github.com/usegraffy.png","language":"JavaScript","readme":"![Graffy logo](public/graffy-logo.svg)\n\n# Graffy [![NPM version](https://img.shields.io/npm/v/@graffy/core?style=flat-square)](https://www.npmjs.com/org/graffy)\n\nGraffy is a toolkit for graph-centric APIs. It has capabilities comparable to GraphQL and Firebase.\n\n## Why?\n\nGraffy supports complex, expressive live queries - with multiple levels of resource expansion and pagination - based on a novel application of [set theory and CRDTs](pages/advanced/01-Theory).\n\n## Client-side example\n\n```js\nimport Graffy from '@graffy/core';\nimport GraffyClient from '@graffy/client';\n\nconst store = new Graffy();\nstore.use(new GraffyClient('/api'));\n\nconst query = {\n  posts: [{ last: 10 }, { // Pagination parameters\n    title: true,\n    author: { name: true }\n  }]\n};\n\nfor await (const state of store.watch(query)) {\n  // Iterates each time relevant data changes on the server.\n  console.log(state);\n}\n```\n\n## Why Graffy?\n\nGraffy provides [live queries](pages/why/02-LiveQueries.md), which give clients a real-time view of the data they need. Graffy supports complex queries with nested graph traversals and pagination, while exposing a simple and intuitive API for building clients and servers.\n\nGraffy was inspired by (and borrows from) Facebook's GraphQL and Netflix's Falcor. Compared to GraphQL, Graffy offers a more familiar data model, true live queries and more efficient caching. Compared to Falcor, it provides cursor-based pagination and real-time subscriptions.\n\nUnlike GraphQL resolvers and Falcor data providers, Graffy providers can be _composed_ like Express/Koa middleware. This allows authentication, validation, custom caches and resource limiting to be implemented in a straightforward manner.\n\nGraffy providers can also perform efficient bulk reads from underlying data stores (for example by constructing optimized SQL queries). This is particularly hard to do with GraphQL (see dataloader) and Falcor.\n\n## [Documentation](https://graffy.js.org)\n\n## Modules\n\nThe [graffy](https://www.npmjs.com/package/graffy) metapackage exports a constructor for a Graffy store in its default configuration.\n\nAll the Graffy packages are published under the [@graffy scope](https://www.npmjs.com/org/graffy) on NPM.\n\n| Module   | Description                         |\n| -------- | ----------------------------------- |\n| core     | Module management                   |\n| fill     | Fulfil queries from many providers  |\n| client   | EventStream/HTTP client             |\n| server   | EventStream/HTTP server             |\n| cache    | In-memory cache                     |\n| common   | Shared utilities                    |\n| react    | React container and hooks API       |\n| stream   | Utility for making AsyncIterables   |\n| testing  | Testing and debugging utilities     |\n| graphql  | Translate GraphQL to Graffy      |\n| schema   | ⌛ Validation, introspection API    |\n| viewer   | ⌛ Schema introspection client      |\n| auth     | ⌛ Authentication and authorization |\n| limit    | ⌛ Resource consumption accounting  |\n| mysql    | ⌛ Data source connector            |\n| postgres | ⌛ Data source connector            |\n\n⌛ = On the roadmap.\n\n## Capabilities\n\n|                    | Graffy | GraphQL | Falcor | Description                                              |\n| ------------------ | :--: | :-----: | :----: | -------------------------------------------------------- |\n| Narrow queries     |  ✅  |   ✅    |   ✅   | Queries specify required fields; Allows API evolution    |\n| Deep queries       |  ✅  |   ✅    |   ✅   | Queries can expand nested resources; Reduces round-trips |\n| Live queries       |  ✅  |   ❌    |   ❌   | Push changes to query results in real time               |\n| Pagination cursors |  ✅  |   ✅    |   ❌   | Enables efficient pagination on the server               |\n| Parameters         |  ✅  |   ✅    |   ❌   | Custom filtering criteria, etc.                          |\n| Caching pages      |  ✅  |   ❌    |   ✅   | Cache result of paginated queries                        |\n| Atomic writes      |  ✅  |   ❌    |   ✅   | Writes that trigger accurate cache invalidation          |\n| Non-data endpoints |  ✅  |   ✅    |   ❌   | Mutations, subscriptions, cross-resource search          |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusegraffy%2Fgraffy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusegraffy%2Fgraffy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusegraffy%2Fgraffy/lists"}