{"id":13725719,"url":"https://github.com/egoist/parse-graphql","last_synced_at":"2025-04-13T15:13:29.690Z","repository":{"id":45275567,"uuid":"186257480","full_name":"egoist/parse-graphql","owner":"egoist","description":"Parse GraphQL Query.","archived":false,"fork":false,"pushed_at":"2021-12-25T13:48:57.000Z","size":30,"stargazers_count":50,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T15:13:24.390Z","etag":null,"topics":["graphql","parse"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/egoist.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}},"created_at":"2019-05-12T13:19:07.000Z","updated_at":"2022-10-22T09:50:35.000Z","dependencies_parsed_at":"2022-09-14T05:11:25.267Z","dependency_job_id":null,"html_url":"https://github.com/egoist/parse-graphql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fparse-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fparse-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fparse-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fparse-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/parse-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732488,"owners_count":21152852,"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":["graphql","parse"],"created_at":"2024-08-03T01:02:32.381Z","updated_at":"2025-04-13T15:13:29.657Z","avatar_url":"https://github.com/egoist.png","language":"JavaScript","readme":"# parse-graphql\n\n[![NPM version](https://badgen.net/npm/v/parse-graphql)](https://npmjs.com/package/parse-graphql) [![NPM downloads](https://badgen.net/npm/dm/parse-graphql)](https://npmjs.com/package/parse-graphql) [![CircleCI](https://badgen.net/circleci/github/egoist/parse-graphql/master)](https://circleci.com/gh/egoist/parse-graphql/tree/master) [![donate](https://badgen.net/badge/support%20me/donate/ff69b4)](https://patreon.com/egoist) [![chat](https://badgen.net/badge/chat%20on/discord/7289DA)](https://chat.egoist.moe)\n\nGiven a GraphQL source, parses it into a Document.\n\nThrows GraphQLError if a syntax error is encountered.\n\nThis module is basically a standalone version (70KB unminified) for `require('graphql').parse` (1.8MB).\n\n## Install\n\n```bash\nyarn add parse-graphql\n```\n\n## Usage\n\n```js\nconst { parse } = require('parse-graphql')\n\nconst document = parse(`{\n  user {\n    name\n    id\n  }\n}`)\n```\n\nThe `document` is:\n\n```js\n{\n  kind: 'Document',\n  definitions: [\n    {\n      kind: 'OperationDefinition',\n      operation: 'query',\n      name: undefined,\n      variableDefinitions: [],\n      directives: [],\n      selectionSet: {\n        kind: 'SelectionSet',\n        selections: [\n          {\n            kind: 'Field',\n            alias: undefined,\n            name: { kind: 'Name', value: 'user', loc: { start: 4, end: 8 } },\n            arguments: [],\n            directives: [],\n            selectionSet: {\n              kind: 'SelectionSet',\n              selections: [\n                {\n                  kind: 'Field',\n                  alias: undefined,\n                  name: {\n                    kind: 'Name',\n                    value: 'name',\n                    loc: { start: 15, end: 19 }\n                  },\n                  arguments: [],\n                  directives: [],\n                  selectionSet: undefined,\n                  loc: { start: 15, end: 19 }\n                },\n                {\n                  kind: 'Field',\n                  alias: undefined,\n                  name: {\n                    kind: 'Name',\n                    value: 'id',\n                    loc: { start: 24, end: 26 }\n                  },\n                  arguments: [],\n                  directives: [],\n                  selectionSet: undefined,\n                  loc: { start: 24, end: 26 }\n                }\n              ],\n              loc: { start: 9, end: 30 }\n            },\n            loc: { start: 4, end: 30 }\n          }\n        ],\n        loc: { start: 0, end: 32 }\n      },\n      loc: { start: 0, end: 32 }\n    }\n  ],\n  loc: { start: 0, end: 32 }\n}\n```\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Author\n\n**parse-graphql** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/parse-graphql/contributors)).\n\n\u003e [github.com/egoist](https://github.com/egoist) · GitHub [@EGOIST](https://github.com/egoist)\n","funding_links":["https://patreon.com/egoist"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fparse-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Fparse-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fparse-graphql/lists"}