{"id":18654226,"url":"https://github.com/phamhongphuc1999/eth-graph-query","last_synced_at":"2026-01-02T22:12:37.754Z","repository":{"id":174110369,"uuid":"651434531","full_name":"phamhongphuc1999/eth-graph-query","owner":"phamhongphuc1999","description":"Simple package for creating query to the GraphQL in ethereum","archived":false,"fork":false,"pushed_at":"2024-08-31T02:26:22.000Z","size":1454,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-07T07:14:19.252Z","etag":null,"topics":["the-graph"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eth-graph-query","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phamhongphuc1999.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-06-09T08:23:17.000Z","updated_at":"2024-08-31T02:26:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"a96eaa72-64e2-429f-8ef3-e96bfb8a338b","html_url":"https://github.com/phamhongphuc1999/eth-graph-query","commit_stats":null,"previous_names":["phamhongphuc1999/eth-graph-query"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phamhongphuc1999%2Feth-graph-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phamhongphuc1999%2Feth-graph-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phamhongphuc1999%2Feth-graph-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phamhongphuc1999%2Feth-graph-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phamhongphuc1999","download_url":"https://codeload.github.com/phamhongphuc1999/eth-graph-query/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231494452,"owners_count":18385248,"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":["the-graph"],"created_at":"2024-11-07T07:14:25.461Z","updated_at":"2026-01-02T22:12:37.692Z","avatar_url":"https://github.com/phamhongphuc1999.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\neth-graph-query\n\u003c/h1\u003e\n\nSimple package for creating query to [the GraphQL](https://thegraph.com/).\n\n---\n\n### Installation\n\n- Using `npm`\n\n```shell\nnpm install eth-graph-query\n\n```\n\n- Using `yarn`\n\n```shell\nyarn add eth-graph-query\n```\n\n- Using `bun`\n\n```shell\nbun install eth-graph-query\n```\n\n---\n\n### Usage\n\n- The first thing you have to do is to create a query instance\n\n```js\nconst query = new EthGraphQuery(root);\n```\n\n- This package has three query options. Simply, you can create a direct string query\n\n```js\nresult = await query.stringQuery(`query query {\n  collection1(first: 10) {\n    element1\n    element2\n  }\n}`);\n```\n\n- More readable, you can create a single json query\n\n```js\nconst result = await query.query({\n  collection: 'collection1',\n  params: {\n    elements: ['element1', 'element2'],\n    first: 10,\n  },\n});\n```\n\n- You can create a multiple json queries\n\n```js\nconst result = await query.multipleQuery([\n  {\n    collection: 'collection1',\n    params: {\n      elements: ['element11', 'element12'],\n    },\n  },\n  {\n    collection: 'collection2',\n    params: {\n      elements: ['element21', 'element22'],\n    },\n  },\n]);\n```\n\n- You can create a complex query\n\n```js\nconst result = await query.multipleQuery([\n  {\n    collection: 'collection1',\n    params: {\n      elements: ['element11', 'element12'],\n      where: { element11: 'abc' },\n    },\n  },\n  {\n    collection: 'collection2',\n    params: {\n      elements: [\n        'element21',\n        {\n          collection: 'collection3',\n          params: {\n            elements: ['element31'],\n            where: {\n              id: { $in: ['123'] },\n              token_: { setId: { $in: ['1', 2, true] } },\n              element31: 'element31',\n            },\n            first: 50,\n          },\n        },\n      ],\n      where: {\n        element21: '123',\n        collection3: { element31: '123' },\n      },\n      inlineFragments: [\n        {\n          collection: 'BridgeDepositTransaction',\n          params: { elements: ['id', 'l1Token'] },\n        },\n        {\n          collection: 'NameSignalTransaction',\n          params: { elements: ['id', 'timestamp'] },\n        },\n      ],\n    },\n  },\n]);\n```\n\n---\n\n### API\n\nRead the [API Docs](https://github.com/phamhongphuc1999/eth-graph-query/blob/main/documents/api.md), you also read my [examples](https://github.com/phamhongphuc1999/eth-graph-query/blob/main/examples)\n\n---\n\n### For developer\n\n- Run example\n\n```shell\nnpm run example example/file-name\n```\n\n- Run test\n\n```shell\nnpm run test\n```\n\n### Reference\n\n- https://spec.graphql.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphamhongphuc1999%2Feth-graph-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphamhongphuc1999%2Feth-graph-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphamhongphuc1999%2Feth-graph-query/lists"}