A Spring Boot GraphQL API for products and categories manager.
- O Mermaid é uma opção bem legal para diagramas e você consegue utilizar diretamente no README.md:
- Java - Version: 17
- Spring Boot - Version: 3.2.2
./mvnw clean package
After that:
java -jar target/spring-with-graphql-0.0.1-SNAPSHOT.jar
After that you can access the application at http://localhost:8080/graphiql and it'll show you the GraphiQL interface.
mutation {
addCategory(category: {name: "Star Wars"}) {
name
id
}
}
query {
categoryById(id: "c40f9427-87fe-452b-9038-e2e33d82b701") {
name
id
}
}
mutation {
addProduct(productInput:{name: "anakin figure action",
price: 100,
categoryId: "7f1e22ec-c621-4ecc-a9c9-8808383d98b5"
}) {
id
}
}
query {
getAllProducts{
id,
category {
id,
name
}
}
}