GraphQL Demo with GraphiQL
The project is a demo to understand the concepts and workflow of GraphQL using GraphiQL interface.
The steps to run and test the application:
- Run the application as a Spring Maven Application
- You can use postman to run the endpoints
- You can check the embedded database h2-console at "http://localhost:8080/h2-console"
- You can use the graphiQL interface to execute GraphQL queries at "http://localhost:8080/graphiql"
Sample GraphiQL Queries/Mutations:
- Mutation
mutation {
newAuthor(firstName:"ABC",lastName:"DEF")
{
id
},
newBook (title:"qwerty", isbn:"13", pageCount:12, author: 3)
{
id
}
}- Query
query {
findAllAuthors
{
id,
firstName,
lastName
}
}- Query
query {
findAllBooks
{
id,
title,
isbn,
pageCount,
author {
id,
firstName,
lastName
}
}
}- Query
query {
countBooks
}