GraphQL API Demo working with mongodb
spring.graphql.graphiql.enabled=true
spring.graphql.graphiql.path=/graphiql
http://localhost:8080/graphiql?path=/graphql
spring.data.mongodb.uri=mongodb://localhost:27017/bookdb
spring.data.mongodb.auto-index-creation=true
{
bookById(id: "book-1") {
name,
pageCount
author {
id,
firstName,
lastName
}
}
}
{
authorById(id: "author-1") {
id,
firstName,
lastName
}
}
mutation INSERT_NEW_AUTHOR {
insertAuthor(createAuthorInput: {
id: "author-1",
firstName: "John",
lastName: "Smith"})
{
id
firstName
lastName
}
}