{"id":16986722,"url":"https://github.com/jmigac/additional-graphql-extensions","last_synced_at":"2026-04-13T02:02:09.180Z","repository":{"id":43211502,"uuid":"465447680","full_name":"jmigac/additional-graphql-extensions","owner":"jmigac","description":"Additional GraphQL Extension created through Java reflection to provide annotation-driven development by providing additional annotations for faster setup of GraphQL objects and easier way of managing DataFetcher objects inside RuntimeWiring object.","archived":false,"fork":false,"pushed_at":"2022-09-16T21:08:24.000Z","size":41,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T06:05:32.736Z","etag":null,"topics":["annotations","dependency","extension","graphql","spring","web-service"],"latest_commit_sha":null,"homepage":"","language":"Java","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/jmigac.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":"2022-03-02T19:46:56.000Z","updated_at":"2024-06-19T01:46:04.000Z","dependencies_parsed_at":"2023-01-18T11:17:52.637Z","dependency_job_id":null,"html_url":"https://github.com/jmigac/additional-graphql-extensions","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jmigac/additional-graphql-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmigac%2Fadditional-graphql-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmigac%2Fadditional-graphql-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmigac%2Fadditional-graphql-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmigac%2Fadditional-graphql-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmigac","download_url":"https://codeload.github.com/jmigac/additional-graphql-extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmigac%2Fadditional-graphql-extensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270116896,"owners_count":24530281,"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-12T02:00:09.011Z","response_time":80,"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":["annotations","dependency","extension","graphql","spring","web-service"],"created_at":"2024-10-14T02:46:44.994Z","updated_at":"2026-04-13T02:02:04.128Z","avatar_url":"https://github.com/jmigac.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Additional Graphql Extensions\n\n### Project information\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jmigac/additional-graphql-extensions/Java%20CI%20with%20Maven?style=for-the-badge)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/jmigac/additional-graphql-extensions?style=for-the-badge)\n[![GitHub license](https://img.shields.io/github/license/jmigac/additional-graphql-extensions?style=for-the-badge)](https://github.com/jmigac/additional-graphql-extensions/blob/main/LICENSE)\n![Lines of code](https://img.shields.io/tokei/lines/github/jmigac/additional-graphql-extensions?style=for-the-badge)\n\n\nAdditional GraphQL Extension created through Java reflection to provide annotation-driven development by providing additional annotations for faster setup of GraphQL objects and easier way of managing DataFetcher objects inside RuntimeWiring object.\n\n## How to add following project as dependency\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.juricamigac\u003c/groupId\u003e\n    \u003cartifactId\u003eadditional-graphql-extensions\u003c/artifactId\u003e\n    \u003cversion\u003euse the latest version\u003c/version\u003e\n\u003c/dependency\u003e\n```\n### How to add github credentials for public packages\nIn your `.m2` find `settings.xml`, and add following code blocks to it.\n\n```\n\u003cserver\u003e\n    \u003cid\u003egithub\u003c/id\u003e\n    \u003cusername\u003e{GITHUB_USERNAME}\u003c/username\u003e\n    \u003cpassword\u003e{GITHUB_PERSONAL_ACCESS_TOKEN}\u003c/password\u003e\n\u003c/server\u003e\n```\nFor **personal access token** access, only \"read packages\" is enough so that maven can resolve the dependency.\n\nUnder repositories add the following code block for repository specification\n```\n\u003crepository\u003e\n    \u003cid\u003egithub\u003c/id\u003e\n    \u003curl\u003ehttps://maven.pkg.github.com/jmigac/additional-graphql-extensions\u003c/url\u003e\n    \u003csnapshots\u003e\n        \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n    \u003creleases\u003e\n        \u003cenabled\u003etrue\u003c/enabled\u003e\n  \u003c/releases\u003e\n\u003c/repository\u003e\n```\n### Additional dependencies which are required to use the following the extension\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.graphql-java\u003c/groupId\u003e\n    \u003cartifactId\u003egraphql-java\u003c/artifactId\u003e\n    \u003cversion\u003e17.3\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.oneandone.reflections8\u003c/groupId\u003e\n    \u003cartifactId\u003ereflections8\u003c/artifactId\u003e\n    \u003cversion\u003e0.11.5\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.commons\u003c/groupId\u003e\n    \u003cartifactId\u003ecommons-lang3\u003c/artifactId\u003e\n    \u003cversion\u003e3.12.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## How to use the GraphQL Extension\n1. Create Configuration class for scanning Graphql packages\n```\n@GraphqlConfiguration\npublic class AutoGraphqlConfiguration {}\n```\n2. Create service for enabling GraphQL objects\n```\n@GQL\npublic class GraphqlService {\n\n    @Getter\n    @GraphqlObject(schemaType = GraphqlObjectEnum.CLASSPATH, schemaValue = \"graphql/shema.graphqls\")\n    private GraphQL graphQL;\n\n    @Getter\n    @RuntimeWiringQL\n    private RuntimeWiring runtimeWiringQL;\n\n}\n```\n3. Now since you have linked the GraphQL schema file to the creation of the GraphQL object, you simply need to define DataFetchers for each of the operations in the schema file.\nProcedure to-do the following is:\n   \n```\n@DataFetcherQL(operationName = \"{NAME_OF_THE_GRAPHQL_OPERATION}\")\npublic class AllEarthquakesDataFetcher implements DataFetcher\u003c{RETURN_TYPE}\u003e {\n\n    @Override\n    public {RETURN_TYPE} get(DataFetchingEnvironment dataFetchingEnvironment) throws Exception {\n        \n    }\n}\n```\n4. Optional step: If your project is logging vast number of ReflectionExceptions, it's because the dependency have reported bug, and to disable this, just disable logging for following package\nInside the `application.properties` add the following line `logging.level.org.reflections8.*=ERROR` \n\n# Perfomance testing\n\nTime for fetching all of the datafetcher objects, setting up the runtime wiring and setting the graphql object.\n\n| Number of data fetchers | Time to setup DataFetchers  | Time to setup Runtime Wiring | Time to setup GraphQL |\n| --- | --- | --- | --- |\n| 1 | 37ms | 38ms | 163ms |\n| 2 | 53ms | 54ms | 203ms |\n| 5 | 42ms | 44ms | 160ms |\n| 10 | 42ms | 43ms | 162ms |\n| 15 | 41ms | 42ms | 161ms |\n| 20 | 39ms | 40ms | 155ms |\n| 30 | 49ms | 50ms | 179ms |\n\n## Summary of test results\nFollowing test results show the that the fetching all of the beans with annotation `@DataFetcherQL` takes about in average 40ms, no matter what is the number of them. Runtime Wiring setup about 1ms to make that object with linking all of the queries and data fetchers to one object.\nGraphQL object takes in average more time, about 160ms, because in case using the schema file, it's needed to load a schema file from resource loader and adapt runtime wiring with loaded file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmigac%2Fadditional-graphql-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmigac%2Fadditional-graphql-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmigac%2Fadditional-graphql-extensions/lists"}