{"id":27377991,"url":"https://github.com/jusexton/spring-graphql-example","last_synced_at":"2026-04-16T10:32:54.075Z","repository":{"id":135725085,"uuid":"199569709","full_name":"jusexton/spring-graphql-example","owner":"jusexton","description":"GraphQL example project using Kotlin and Spring Boot.","archived":false,"fork":false,"pushed_at":"2019-08-12T03:43:26.000Z","size":611,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T22:58:02.058Z","etag":null,"topics":["example-project","graphql","kotlin","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/jusexton.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}},"created_at":"2019-07-30T03:44:37.000Z","updated_at":"2019-10-31T19:25:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2a44fb6-7bea-4b0d-a9f1-dcc6d0dfaa7c","html_url":"https://github.com/jusexton/spring-graphql-example","commit_stats":null,"previous_names":["jusexton/spring-graphql-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jusexton/spring-graphql-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fspring-graphql-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fspring-graphql-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fspring-graphql-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fspring-graphql-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jusexton","download_url":"https://codeload.github.com/jusexton/spring-graphql-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jusexton%2Fspring-graphql-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["example-project","graphql","kotlin","spring-boot"],"created_at":"2025-04-13T13:09:04.047Z","updated_at":"2026-04-16T10:32:54.056Z","avatar_url":"https://github.com/jusexton.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring GraphQL Example\n\nSmall CRUD application demonstrating how to build a GraphQL API with Kotlin, MongoDB and Spring Boot.\n\nYou will need a mongo instance to connect too for this application to work.\n\n## GraphQL Dependencies\n```\nimplementation 'com.graphql-java:graphiql-spring-boot-starter:5.0.2'\nimplementation 'com.graphql-java:graphql-spring-boot-starter:5.0.2'\nimplementation 'com.graphql-java:graphql-java-tools:5.2.4'\n```\n\n## GraphiQL\n\n### Adding New Users\n![Alt text](screenshots/mutation-screenshot.png?raw=true \"Mutation Screenshot\")\n\n```\ntype Mutation {\n    # Used to create a new user in the system\n    createUser(input: UserInput!): User!\n}\n```\n\n```kotlin\nfun createUser(userInput: UserInput) = userRepository.save(User(userInput.username, userInput.address))\n```\n\n### Querying Users\n![Alt text](screenshots/query-screenshot.png?raw=true \"Query Screenshot\")\n\n```\nextend type Query {\n    # Retrieves a user by their id\n    userById(id: String!): User\n\n    # Used to retrieve all users in the system.\n    allUsers(filter: UserFilter): [User]!\n}\n```\n\n```kotlin\nfun userById(id: String) = userService.repository.findById(id).orElseThrow { UserNotFoundException(id) }\n\nfun allUsers(filter: UserFilter?) = userService.findAll(filter)\n```\n\n### Error Messages\n![Alt text](screenshots/error-screenshot.png?raw=true \"Error Screenshot\")\n\n```kotlin\n@Component\nclass ErrorHandler : GraphQLErrorHandler {\n    override fun processErrors(errors: MutableList\u003cGraphQLError\u003e?): MutableList\u003cGraphQLError\u003e =\n            errors?.map { getNested(it) }?.toMutableList() ?: mutableListOf()\n\n    private fun getNested(error: GraphQLError): GraphQLError =\n            if (error is ExceptionWhileDataFetching \u0026\u0026 error.exception is GraphQLError) error.exception as GraphQLError else error\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjusexton%2Fspring-graphql-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjusexton%2Fspring-graphql-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjusexton%2Fspring-graphql-example/lists"}