{"id":22804838,"url":"https://github.com/DiyorUmarkulov/gql-module","last_synced_at":"2025-08-10T04:32:12.168Z","repository":{"id":267443692,"uuid":"901263710","full_name":"DiyorUmarkulov/gql-module","owner":"DiyorUmarkulov","description":"GraphQL Module Builder is a library designed to simplify working with GraphQL modules, enabling you to quickly create, register, and combine types and resolvers into a modular structure.","archived":false,"fork":false,"pushed_at":"2024-12-20T14:36:48.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T07:27:26.260Z","etag":null,"topics":["apollo-server","gql-api","graphql","library","module","package","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/DiyorUmarkulov.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,"zenodo":null}},"created_at":"2024-12-10T10:41:37.000Z","updated_at":"2025-02-06T18:04:52.000Z","dependencies_parsed_at":"2024-12-10T11:39:39.474Z","dependency_job_id":"f8b53265-c297-42a9-b0a7-a6d661d20178","html_url":"https://github.com/DiyorUmarkulov/gql-module","commit_stats":null,"previous_names":["diyor2009/gql-module","diyorumarkulov/gql-module"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DiyorUmarkulov/gql-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiyorUmarkulov%2Fgql-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiyorUmarkulov%2Fgql-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiyorUmarkulov%2Fgql-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiyorUmarkulov%2Fgql-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiyorUmarkulov","download_url":"https://codeload.github.com/DiyorUmarkulov/gql-module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiyorUmarkulov%2Fgql-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269677393,"owners_count":24457846,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apollo-server","gql-api","graphql","library","module","package","typescript-library"],"created_at":"2024-12-12T10:09:36.515Z","updated_at":"2025-08-10T04:32:12.159Z","avatar_url":"https://github.com/DiyorUmarkulov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Module Builder 🚀\n\n**GraphQL Module Builder** is a library designed to simplify working with GraphQL modules, enabling you to quickly create, register, and combine types and resolvers into a modular structure.\n\n## Purpose and Motivation 🌟\n\n### 1. **Simplifying Modular Architecture Development in GraphQL** 🛠️\n\nAs GraphQL applications scale, organizing the codebase can become challenging. This library allows developers to structure code using modules, where each module encapsulates types and resolvers for a specific functionality.\n\n### 2. **Improved Readability and Maintainability** 📚\n\nA clear, module-based structure makes the code easy to understand and maintain. Each module manages a distinct part of the application, reducing conflicts between resolvers and simplifying the addition of new features.\n\n### 3. **Automated Type and Resolver Aggregation** 🤖\n\nInstead of manually aggregating types and resolvers, the library automatically generates the final `typeDefs` and `resolvers`. This eliminates repetitive tasks, reduces errors, and accelerates development.\n\n### 4. **Flexibility in Resolver Creation** ⚡\n\nThe library provides a straightforward API for creating resolvers with clear separation of queries, mutations, and subscriptions. This lets developers focus on business logic rather than infrastructure details.\n\n---\n\n## Installation 📦\n\nInstall the library using npm or yarn:\n\n```bash\nnpm install gql-module\n```\n\nor\n\n```bash\nyarn add gql-module\n```\n\n---\n\n## Usage 💡\n\nHere’s an example of how to use **GraphQL Module Builder**:\n\n```typescript\nimport { gql } from \"apollo-server-core\";\nimport { resolvers, gqlModule, registerModules } from \"gql-module\";\n\n// 📄 Define GraphQL types\nconst userTypes = gql`\n  type User {\n    name: String\n    password: String\n  }\n\n  type UsersOutput {\n    payload: [User]\n  }\n`;\n\n// 🔧 Define GraphQL resolvers\nconst userQueries = resolvers({\n  getAllUsers: {\n    handler: async () =\u003e {\n      // Simulate fetching data\n      return { payload: [{ name: \"Alice\", password: \"hidden\" }] };\n    },\n    type: \": UsersOutput\",\n  },\n});\n\n// 🧩 Create a GraphQL module\nconst userModule = gqlModule({\n  resolvers: {\n    queries: userQueries,\n  },\n  types: [userTypes],\n});\n\n// 🔗 Register modules and retrieve final types and resolvers\nconst { resolvers: builtResolvers, typeDefs } = registerModules([userModule]);\n\n// ✅ Log results\nconsole.log(\"builtResolvers\", builtResolvers);\n// Result:\n// builtResolvers { Query: { getAllUsers: [Function: builtResolver] } }\n\nconsole.log(\"typeDefs\", typeDefs.loc.source.body);\n// Result:\n// typeDefs\n//   type User {\n//     name: String\n//     password: String\n//   }\n//\n//   type UsersOutput {\n//     payload: [User]\n//   }\n//\n//   type Query {\n//     getAllUsers: UsersOutput\n//   }\n```\n\n---\n\n## License 📜\n\nThis library is distributed under the MIT License. The full license text can be found in the [LICENSE](./LICENSE) file.\n\n---\n\nWe hope this library simplifies your work with GraphQL! 💻 If you have ideas for improvements or encounter issues, we’d love to hear from you in the [Issues](https://github.com/Diyor2009/gql-module/issues) section!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDiyorUmarkulov%2Fgql-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDiyorUmarkulov%2Fgql-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDiyorUmarkulov%2Fgql-module/lists"}