Skip to content

ramonjoaquim/spring-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring-boot + GraphQL

Study by graphQL with Spring boot

Setup project

run project normally

mvn spring-boot:run

the project has a dependency called graphiql-spring-boot-starter with serve a gui client for run querys graphQL on the port

http://localhost:8080/graphiql

for h2 console

http://localhost:8080/h2-console

Example for get all trainers

query {
    getAllTrainers {
        id
        name
        age
        gym {
            id
            name
        },
        pokemons {
            id
            name
            category
        },
        insignias {
            id
            name
        }

    }
}

Example of Mutation that create a new Trainer this create a new trainer and return ID created

mutation {
    createTrainer(trainer: {name: "Gary", age: 15}) {
        id
    }
}

About

Study about graphQL in spring boot framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages