Skip to content

About

GraphQL with Spring Boot: queries, mutations, @BatchMapping and subscriptions

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-spring-example

GraphQL with Java and Spring Boot (Spring for GraphQL):

  • queries (getUserById, getAllUsers) and a mutation (addNewUser)
  • @BatchMapping to load addresses in one batch instead of one call per user (no N+1)
  • a subscription over WebSocket (greetNewUsers)

Companion code for my article GraphQL with Java and Spring Boot.

Run it

Start GraphqlSpringExampleApplication, then open GraphiQL at http://localhost:8080/graphiql and try:

query { getAllUsers { userId firstName address { city } } }

Spring Boot 2.7, Java 17. Data is kept in memory.

About

GraphQL with Spring Boot: queries, mutations, @BatchMapping and subscriptions

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages