{"id":29904413,"url":"https://github.com/lfrei/wishlist","last_synced_at":"2026-05-19T04:04:43.834Z","repository":{"id":230663299,"uuid":"437238817","full_name":"lfrei/wishlist","owner":"lfrei","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-14T09:08:15.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-07T18:24:54.338Z","etag":null,"topics":["graphql","graphql-java"],"latest_commit_sha":null,"homepage":"","language":"Java","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/lfrei.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":"2021-12-11T09:26:28.000Z","updated_at":"2021-12-14T09:08:18.000Z","dependencies_parsed_at":"2024-03-31T06:51:00.121Z","dependency_job_id":"51900d8e-61f3-4a6e-ada8-588d0caaf5a3","html_url":"https://github.com/lfrei/wishlist","commit_stats":null,"previous_names":["lfrei/wishlist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lfrei/wishlist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfrei%2Fwishlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfrei%2Fwishlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfrei%2Fwishlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfrei%2Fwishlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfrei","download_url":"https://codeload.github.com/lfrei/wishlist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfrei%2Fwishlist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268270633,"owners_count":24223504,"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-01T02:00:08.611Z","response_time":67,"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":["graphql","graphql-java"],"created_at":"2025-08-01T17:42:27.458Z","updated_at":"2026-05-19T04:04:38.792Z","avatar_url":"https://github.com/lfrei.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wishlist using GraphQL\n\nA simple implementation of a GraphQL Server with [graphql-java](https://github.com/graphql-java/graphql-java). \nUse branch `dgs` to see the same implementation with the [dgs-framework by netflix](https://github.com/netflix/dgs-framework/) that is building on top of graphql-java.\n\n## Schema\n\n```\ntype Query {\n    wishById(id: ID): Wish\n}\n\ntype Mutation {\n    createWish(id: String!, name: String!, description: String!, ageRating: Int): Wish\n}\n\ntype Wish {\n    id: ID\n    name: String\n    description: String\n    ageRating: Int\n    giftedFrom: Person\n    givenTo: Person\n}\n\ntype Person {\n    id: ID\n    name: String\n    age: Int\n}\n```\n\n## Examples\n\n### Query\n\n```\n{\n  wishById(id: \"wish-1\"){\n    name,\n    description\n    ageRating\n    givenTo {\n      name\n    }\n    giftedFrom {\n      name\n    }\n  }\n}\n```\n\n### Mutation\n\n```\nmutation {\n  createWish(\n    id: \"wish-2\",\n    name: \"Gin\",\n    description: \"Monkey 47 Gin, 50cl\",\n    ageRating: 18\n  ){\n    name,\n    description\n    ageRating\n  }\n}\n```\n\n## Thoughts about GraphQL\n\n### Usage\n\n- Twitter is using graphql and has recently migrated to graphql-java, see [discussion](https://github.com/graphql-java/graphql-java/discussions/2591).\n- Github has a [graphql api](https://docs.github.com/en/graphql/overview/about-the-graphql-api) and explains why it has moved to [graphql](https://github.blog/2016-09-14-the-github-graphql-api/).\n- Graphql adopter [landscape](https://landscape.graphql.org/?category=graph-ql-adopter\u0026grouping=category\u0026style=borderless\u0026zoom=150)\n\n### Language Support\n\nAll major technologies support the graphql specification by now [1].\n\n### Client control over what data is fetched\n\nThe client is able to control what data should be requested. \nIn REST, if an endpoint is used by multiple clients there is often more data in the response than needed.\nWith graphql, the client can request only the needed data, resulting in smaller and more suitable queries.\nThis is also helpful when dealing with devices with smaller bandwidth [2].\n\n### Performing expensive queries\n\nBecause of the design of graphql, the client can decide what data should be requested. This could lead to \nvery expensive queries where a client requests a lot of fields from a lot of resources [2]. This can have a big impact\non the server and its resources (sometimes multiple involved microservices), without being able to control it.\nSimilar to SQL, it is very hard to optimize for such expensive / complex queries.\n\n### Aggregate data from multiple sources\n\nGraphql can reduce the round trip, when data from multiple data sources (e.g. multiple microservices) is needed.\nIn REST this would require multiple HTTP calls. In graphql this can be solved by defining multiple data types to\naggregate the data from multiple sources (see example) [3]. With this, graphql can be used as aggregation gateway \nor act like a BFF [4].\n\n### Writes \u0026 Mutations\n\nGraphql supports writes by using the `mutation` keyword [5]. Similar to REST, \nany query could theoretically modify data, but using `mutation` is recommended. \nGraphql is mostly used for read queries, while writes are often still made using REST [3].\n\n### Error Handling\n\nThere is no uniform error handling compared to REST, where the HTTP codes provide a clear structure\nfor unsuccessful responses. In graphql errors, there is only a `message` field required by the graphql spec, \nother fields are optional [6]. Because the response is always HTTP code `200`, errors need to be handled manually. \nSome libs define their own contract [7].\n\n### Source\n\n- [1] https://graphql.org/code/\n- [2] https://blog.logrocket.com/why-you-shouldnt-use-graphql/\n- [3] Sam Newman, \"Building Microservices Second Edition\", O'Reilly, 2021\n- [4] https://samnewman.io/patterns/architectural/bff/\n- [5] https://graphql.org/learn/queries/#mutations\n- [6] https://spec.graphql.org/October2021/#sec-Errors\n- [7] https://netflix.github.io/dgs/error-handling/#the-graphqlerror-interface\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfrei%2Fwishlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfrei%2Fwishlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfrei%2Fwishlist/lists"}