{"id":17717710,"url":"https://github.com/mununki/gqlmerge","last_synced_at":"2025-04-30T22:23:35.308Z","repository":{"id":42430953,"uuid":"186962882","full_name":"mununki/gqlmerge","owner":"mununki","description":"A tool to merge \u0026 stitch the modularized GraphQL schema files into one schema","archived":false,"fork":false,"pushed_at":"2024-04-02T08:51:46.000Z","size":198,"stargazers_count":56,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T09:25:45.845Z","etag":null,"topics":["go","golang","graphql","merge","stitch"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mununki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-05-16T06:11:50.000Z","updated_at":"2024-08-12T10:45:52.000Z","dependencies_parsed_at":"2023-12-14T12:25:42.207Z","dependency_job_id":"a73fe624-3932-470f-986d-451358938380","html_url":"https://github.com/mununki/gqlmerge","commit_stats":null,"previous_names":["mattdamon108/gqlmerge"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Fgqlmerge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Fgqlmerge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Fgqlmerge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Fgqlmerge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mununki","download_url":"https://codeload.github.com/mununki/gqlmerge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251790365,"owners_count":21644209,"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":["go","golang","graphql","merge","stitch"],"created_at":"2024-10-25T14:29:40.206Z","updated_at":"2025-04-30T22:23:35.279Z","avatar_url":"https://github.com/mununki.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gqlmerge\n\nA tool to merge and stitch modularized GraphQL files into one schema file\n\n## Demo\n\n![Demo](/demo/gqlmerge_demo.gif)\n\n## Stack\n\n- Built in Go\n- No 3rd party dependency\n\n## Features\n\n- Fast, blasing fast\n- Find `*.graphql` and `*.gql` files in recursive way\n- Merge and stitch schema from several directories\n- CLI to use in shell or script\n\n## How to use\n\n### Install to use in CLI\n\nHomebrew\n\n```shell\n$ brew install mununki/tools/gqlmerge\n```\n\nUsing `go get`\n\n```shell\n$ go get -u github.com/mununki/gqlmerge\n```\n\nBuilding with source code\n\n```shell\n$ git clone https://github.com/mununki/gqlmerge\n\n$ cd gqlmerge\n\n$ go install\n```\n\n### Use as a go module\n\nImport gqlmerge module\n\n```go\nimport gql \"github.com/mununki/gqlmerge/lib\"\n\nfunc main(){\n\t// ...\n\n\t// \"  \" is indent for the padding in generating schema\n\t// in case of using as go module, just \" \" would be fine\n\t//\n\t// paths should be a relative path\n\tschema := gql.Merge(\" \", path1, path2, ...)\n}\n```\n\n## What for?\n\nIf you have a modularized GraphQL schema files, such as `*.graphql`, there might be a duplicated types among them. In this case, `gqlmerge` will help you to merge and stitch it into one schema.\n\n_Before_\n\n```graphql\n# GetMyProfile.graphql\n\ntype Query {\n  getMyProfile: UserResponse!\n}\n\ntype UserResponse {\n  ok: Boolean!\n  error: String\n  user: User\n}\n\ntype User {\n  id: ID!\n  email: String!\n  fullName: String!\n  # ...\n}\n\n# CheckIfExists.graphql\n\ntype Query {\n  checkIfExists(userId: ID!): CheckIfExistsResponse!\n}\n\ntype CheckIfExistsResponse {\n  ok: Boolean!\n  error: String\n  user: [User]!\n}\n\ntype User {\n  id: ID!\n  email: String!\n  fullName: String!\n  # ...\n}\n```\n\n_Merge \u0026 Stitch_\n\n```shell\n$ gqlmerge ./schema schema.graphql\n```\n\n_After_\n\n```graphql\ntype Query {\n  getMyProfile: UserResponse!\n  checkIfExists(userId: ID!): CheckIfExistsResponse!\n}\n\ntype UserResponse {\n  ok: Boolean!\n  error: String\n  user: User\n}\n\ntype CheckIfExistsResponse {\n  ok: Boolean!\n  error: String\n  user: [User]!\n}\n\ntype User {\n  id: ID!\n  email: String!\n  fullName: String!\n  # ...\n}\n```\n\n## How to use\n\n```shell\n$ gqlmerge --indent=2s [PATH ...] [OUTPUT]\n\n// PATH : directories with schema\n// OUTPUT : output file name\n```\n\n## Next to do\n\n- [ ] additional error handling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Fgqlmerge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmununki%2Fgqlmerge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Fgqlmerge/lists"}