{"id":20903728,"url":"https://github.com/mihajlonesic/spring-graphql-mysql","last_synced_at":"2025-04-11T05:36:13.692Z","repository":{"id":107264133,"uuid":"212988870","full_name":"MihajloNesic/spring-graphql-mysql","owner":"MihajloNesic","description":"Getting Started with Spring Boot, GraphQL and MySQL. Please take a look at a newer version https://github.com/MihajloNesic/numista-graphql","archived":false,"fork":false,"pushed_at":"2020-03-23T23:58:12.000Z","size":20,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T03:34:54.843Z","etag":null,"topics":["graphql","mysql","spring","spring-boot"],"latest_commit_sha":null,"homepage":"https://github.com/MihajloNesic/numista-graphql","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/MihajloNesic.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,"publiccode":null,"codemeta":null}},"created_at":"2019-10-05T11:36:14.000Z","updated_at":"2025-01-14T10:23:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfcfe9b8-0ab7-4f86-b6e9-d784c64acc2b","html_url":"https://github.com/MihajloNesic/spring-graphql-mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihajloNesic%2Fspring-graphql-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihajloNesic%2Fspring-graphql-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihajloNesic%2Fspring-graphql-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MihajloNesic%2Fspring-graphql-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MihajloNesic","download_url":"https://codeload.github.com/MihajloNesic/spring-graphql-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248349099,"owners_count":21088979,"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":["graphql","mysql","spring","spring-boot"],"created_at":"2024-11-18T13:14:45.144Z","updated_at":"2025-04-11T05:36:13.672Z","avatar_url":"https://github.com/MihajloNesic.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot - GraphQL - MySQL\n[![Spring Boot](https://i.imgur.com/9zObPwT.png)](https://spring.io/projects/spring-boot)\n[![GraphQL](https://i.imgur.com/TRGUDTv.png)](https://graphql.org/)\n[![MySQL](https://i.imgur.com/0IydTPv.png)](https://www.mysql.com/)\u003cbr\u003e\nGetting Started with Spring Boot, GraphQL and MySQL\n\n## Data\n\nThis demo application communicates with a MySQL database `graphql_db`. The sql file is located in 'resources' folder.\n\nThere are three tables: `language`, `user` and `project`. \n\nEach project has a language and a user that created that project.\n\n_Note that this database and data are just for demonstration purposes._\n\n## Usage\n\nGraphQL endpoint is located at `http://localhost:8080/graphql` and can be changed in `application.properties` file.\n\nTo use GraphiQL, locate `http://localhost:8080/graphiql` (notice 'i' in graphiql).\n\nThe `.graphqlconfig` file is located in `resources/graphql` folder. The file is used to execute GraphQL from the IntelliJ IDEA.\n\n![IntelliJ IDEA GraphQL](https://i.imgur.com/ze6buJW.png)\n\n#### Queries\n\n`allLanguages` - Returns all languages in the database\u003cbr\u003e\n`language(id: ID!)` - Returns one language with passed ID\u003cbr\u003e\n`languageType(languageType: String!)` - Returns languages with passed type (programming, data or markup)\u003cbr\u003e\n`allProjects: [Project]` - Returns all projects in the database\u003cbr\u003e\n`project(id: ID!): Project` - Returns one project with passed ID\u003cbr\u003e\n`userProjects(userId: ID!): [Project]` - Returns all projects created by the user with passed ID\u003cbr\u003e\n`allUsers: [User]` - Returns all users in the database\u003cbr\u003e\n`user(id: ID!): User` - Returns one user with passed ID\n\n#### Mutations\n\n`createLanguage(name: String, code: String, color: String, languageType: String): Language!` - Creates a new language\u003cbr\u003e\n`updateLanguage(id: ID!, name: String, code: String, color: String, languageType: String): Language!` - Updates an existing language\u003cbr\u003e\n`deleteLanguage(id: ID!): Boolean` - Deletes a language by ID\u003cbr\u003e\n`createProject(title: String, description: String, language: ID!, user: ID!): Project!` - Creates a new project\u003cbr\u003e\n`updateProject(id: ID!, title: String, description: String, language: ID, user: ID): Project!` - Updates an existing project\u003cbr\u003e\n`deleteProject(id: ID!): Boolean` -  Deletes a project by ID\u003cbr\u003e\n`createUser(username: String, email: String): User!` - Creates a new user\u003cbr\u003e\n`updateUser(id: ID!, username: String, email: String): User!` - Updates an existing user\u003cbr\u003e\n`deleteUser(id: ID!): Boolean` -  Deletes a user by ID\n\n#### Demo Usage\n\nReturns name, color and language type for a language with ID 1\n```graphql\nquery {\n    language(id: 1) {\n        name\n        color\n        languageType\n    }\n}\n```\n\nReturns id and name of all languages with type 'programming'\n```graphql\nquery {\n    languageType(languageType: \"programming\") {\n        id\n        name\n    }\n}\n```\n\nCreates a new language and returns id and name\n```graphql\nmutation {\n  createLanguage(name: \"Kotlin\", code: \"kotlin\", color: \"F18E33\", languageType: \"PROGRAMMING\") {\n      id \n      name\n  }\n}\n```\n\nUpdates email for user with ID 5 and returns id, username and email\n```graphql\nmutation {\n  updateUser(id: 5, email: \"mihajlo.nesic@email.com\") {\n      id \n      username\n      email\n  }\n}\n```\n\nDeletes user with ID 4\n```graphql\nmutation {\n  deleteUser(id: 4)\n}\n```\n\nReturns all projects created by user with ID 2\n```graphql\nquery {\n  userProjects(userId: 2) {\n    id\n    title\n    language {\n      name\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihajlonesic%2Fspring-graphql-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihajlonesic%2Fspring-graphql-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihajlonesic%2Fspring-graphql-mysql/lists"}