It returns a list of dogs from an embedded H2 in memory database. It uses Spring Initializer to bootstrap the project with following dependencies:
spring-boot-starter-web
- This starter pack is used for web application development and automatically adds libraries like Spring MVC, REST, Tomcat, and Jackson.com.h2database
- This starter pack is used for the H2 in-memory database.spring-boot-starter-data-jpa
- This starter pack includes JDBC, Hibernate, Transactions API, JPA, and Aspects.graphql-spring-boot-starter
- GraphQL Spring Boot Frameworkgraphql-java-tools
- Tools to help map a GraphQL schema to existing Java objectsgraphiql-spring-boot-starter
- GraphQL Spring Boot Framework
classDiagram
class Dog
Dog: Long id
Dog: String name
Dog: String breed
Dog: String origin
URL: http://localhost:8080/graphiql
Schema
type Dog {
id: ID!
name: String!
breed: String!
origin: String!
}
type Query {
findAllDogs: [Dog]!
findDogById(id:ID!): Dog!
}
type Mutation {
deleteDogBreed(breed: String!) : Boolean
updateDogName(newName: String!, id:ID!) : Dog!
}