This Project's Goal,Learning GraphQL in a Spring Boot Application
- Spring Boot
- Spring Boot Test
- Spring Boot Web
- Spring Boot JPA
- H2 Database
- Lombok
- GraphQL
- Graphiql
- First,define GraphQL dependencies
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
<version>12.0.0</version>
</dependency>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-java-tools</artifactId>
<version>12.0.0</version>
</dependency>
- Second,create a .graphqls file and configure your project settings
- Third,Set Database settings in application.properties(or .yml file)
- Fourth,Define Graphiql dependency in pom.xml(Optional)
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
<version>5.0.2</version>
</dependency>
And Connect "localhost:"yourServerPort"/graphiql
- Save A person
- List All Persons
- Get A Person
- Delete A person