https://github.com/techprimers/spring-boot-graphql-query-example
Spring Boot with GraphQL Query Example
https://github.com/techprimers/spring-boot-graphql-query-example
Last synced: 12 months ago
JSON representation
Spring Boot with GraphQL Query Example
- Host: GitHub
- URL: https://github.com/techprimers/spring-boot-graphql-query-example
- Owner: TechPrimers
- Created: 2018-01-10T15:48:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T10:30:34.000Z (over 3 years ago)
- Last Synced: 2025-04-07T23:38:26.072Z (over 1 year ago)
- Language: Java
- Size: 49.8 KB
- Stars: 98
- Watchers: 2
- Forks: 105
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot with GraphQL Query Example
Update: Upgraded to Java 11 and Graph QL to 5+ version dependency
## Book Store
- `/rest/books` is the REST resource which can fetch Books information
- DataFetchers are Interfaces for RuntimeWiring of GraphQL with JpaRepository
## Sample GraphQL Scalar Queries
- Accessible under `http://localhost:8091/rest/books`
- Usage for `allBooks`
```
{
allBooks {
isn
title
authors
publisher
}
}
```
- Usage for `book`
```
{
book(id: "123") {
title
authors
publisher
}
```
- Combination of both `allBooks` and `book`
```
{
allBooks {
title
authors
}
book(id: "124") {
title
authors
publisher
}
}
```