{"id":16743940,"url":"https://github.com/zshipko/irmin-graphql-js","last_synced_at":"2025-08-09T15:20:04.112Z","repository":{"id":40710817,"uuid":"146928387","full_name":"zshipko/irmin-graphql-js","owner":"zshipko","description":"Irmin GraphQL bindings for Javascript","archived":false,"fork":false,"pushed_at":"2022-08-12T22:48:38.000Z","size":32,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T12:21:28.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zshipko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-31T18:22:27.000Z","updated_at":"2024-11-04T23:59:26.000Z","dependencies_parsed_at":"2022-07-29T03:48:16.471Z","dependency_job_id":null,"html_url":"https://github.com/zshipko/irmin-graphql-js","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/zshipko%2Firmin-graphql-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Firmin-graphql-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Firmin-graphql-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Firmin-graphql-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zshipko","download_url":"https://codeload.github.com/zshipko/irmin-graphql-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225966,"owners_count":21068091,"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-10-13T01:42:02.046Z","updated_at":"2025-04-10T13:40:54.794Z","avatar_url":"https://github.com/zshipko.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# irmin-graphql-js\n\n`irmin-graphql-js` is a Javascript library for communicating directly with [irmin-graphql](https://github.com/mirage/irmin) GraphQL servers.\n\n## Getting started\n\nTo create an Irmin instance:\n\n```javascript\nvar ir = new Irmin(\"https://127.0.0.1:8080/graphql\");\n```\n\nSetting a value:\n\n```javascript\nlet commit = await ir.main().set(\"a/b/c\", \"123\");\nconsole.log(commit.hash);\n```\n\nGetting a value:\n\n```javascript\nlet value = await ir.main().get(\"a/b/c\");\nconsole.log(value);\n```\n\n## Writing custom queries\n\nOnce you get past the most basic operations you will most likely need to write and execute custom queries. `irmin.js` makes this easy:\n\n```javascript\nlet body = `\n    query GetExample($key: String!) {\n        main {\n          tree {\n            get(key: $key)\n          }\n        }\n    }\n`;\n\nlet query = {\n    body: body,\n    vars: {\n        key: \"a/b/c\"\n    },\n    operation: \"GetExample\"\n};\n\nlet res = await ir.execute(query);\nconsole.log(res.main.tree.get);\n```\n\nIn the example above, `body` is a string containing the actual query, `data` is an object with `body`, `vars` and `operation` fields. The `vars` and `operation` fields may be left undefined if not in use.\n\n## Examples\n\nThere are some examples using NodeJS in the `examples/` directory, they require the `node-fetch` package to be installed via npm.\n\nYou may also be interested in checking out the [GraphQL](https://irmin.io/tutorial/graphql) section of the [Irmin Tutorial](https://irmin.io/tutorial)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzshipko%2Firmin-graphql-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzshipko%2Firmin-graphql-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzshipko%2Firmin-graphql-js/lists"}