{"id":27078742,"url":"https://github.com/rodrigobalazs/springboot-graphql","last_synced_at":"2025-10-31T03:46:08.728Z","repository":{"id":286202141,"uuid":"960699356","full_name":"rodrigobalazs/springboot-graphql","owner":"rodrigobalazs","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-07T17:23:05.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T20:17:30.324Z","etag":null,"topics":["docker","graphql","graphql-api","java","maven","springboot","springdata"],"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/rodrigobalazs.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}},"created_at":"2025-04-04T22:29:35.000Z","updated_at":"2025-04-07T17:23:08.000Z","dependencies_parsed_at":"2025-04-04T23:37:08.250Z","dependency_job_id":null,"html_url":"https://github.com/rodrigobalazs/springboot-graphql","commit_stats":null,"previous_names":["rodrigobalazs/springboot-graphql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigobalazs%2Fspringboot-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigobalazs%2Fspringboot-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigobalazs%2Fspringboot-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigobalazs%2Fspringboot-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrigobalazs","download_url":"https://codeload.github.com/rodrigobalazs/springboot-graphql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103859,"owners_count":21048245,"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":["docker","graphql","graphql-api","java","maven","springboot","springdata"],"created_at":"2025-04-06T01:17:46.778Z","updated_at":"2025-10-31T03:46:03.696Z","avatar_url":"https://github.com/rodrigobalazs.png","language":"Java","readme":"# springboot-graphql\n\n## Spring Boot GraphQL API\nThis repository contains an Spring Boot 'Store Application' which expose a GraphQL API with Queries and Mutations\nused to manage operations related to the Store´s Products.\n\n### 🔧 Technology Stack\n\n```\nJava 17\nSpring Boot 3\nSpring for GraphQL ( GraphQL API )\nSpring Data ( MySQL )\nMisc Libraries (  Maven  /  Docker /  Lombok /  Apache Commons  )\n```\n\n### ⚒️ Getting Started\n\n```bash\n# clone the project\ngit clone https://github.com/rodrigobalazs/springboot-graphql.git;\ncd springboot-graphql;\n\n# start a mysql docker container\ndocker run --name store_db -e MYSQL_DATABASE=store_db -e MYSQL_USER=\u003cuser\u003e \\\n    -e MYSQL_PASSWORD=\u003cpass\u003e -e MYSQL_ROOT_PASSWORD=\u003cpass\u003e \\\n    -p 3306:3306 -d mysql:latest;\n\n# make sure to update application.properties with the\n# MYSQL_USER and MYSQL_PASSWORD values defined in the previous point\nspring.datasource.username=\u003cuser\u003e\nspring.datasource.password=\u003cpass\u003e\n\n# compile and start the spring boot server\nmvn clean install;\nmvn spring-boot:run;\n```\n\n### 💡 GraphQL API Examples\n\n#### 1. Get all the available Products =\u003e\n```\ncurl -X POST http://localhost:8080/graphql  \\\n     -H 'accept: application/json'  \\\n     -H 'Content-Type: application/json' -d \\\n'{\n    \"query\": \"{ allProducts { id name price } }\"\n}';\n```\n\n#### 2. Get all the available Products ( via HTTPie ) =\u003e\n```\nhttp POST http://localhost:8080/graphql query=\"{ allProducts { id name price } }\";\n```\n\n#### 3. Retrieves a Product by Product Name (e.g 'Rustic Sofa') and only fetch in particular the product´s price =\u003e\n```\ncurl -X POST http://localhost:8080/graphql  \\\n     -H 'accept: application/json'  \\\n     -H 'Content-Type: application/json' -d \\\n'{\n    \"query\": \"{ productByName(name:\\\"Rustic Sofa\\\") { price } }\"\n}';\n```\n\n#### 4. Creates a new 'Triathlon Suit' Product =\u003e\n```\ncurl -X POST http://localhost:8080/graphql  \\\n     -H 'accept: application/json'  \\\n     -H 'Content-Type: application/json' -d \\\n'{\n    \"query\":\"mutation { addProduct(name:\\\"Triathlon Suit\\\", price:250.1) { id name price } }\"\n}';\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigobalazs%2Fspringboot-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrigobalazs%2Fspringboot-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigobalazs%2Fspringboot-graphql/lists"}