Skip to content

Sample GraphQL server implemented with graphql-java and Spring Boot

License

Notifications You must be signed in to change notification settings

danzalot/graphql-java-spring-boot-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-java-spring-boot-example

Sample app for my tutorial Building a GraphQL Server with Spring Boot.

You'll need Java 9.

Clone this repo and execute mvnw spring-boot:run. Or inside an IDE, execute the class com.example.DemoGraphQL.DemoGraphQlApplication.

You can go to http://localhost:8080/h2-console/login.jsp and enter the following information:

  • JDBC URL: jdbc:h2:mem:testdb
  • User Name: sa
  • Password:

To check the database or to http://localhost:8080/graphiql to start executing queries. For example:

{
  findAllBooks {
    id
    isbn
    title
    pageCount
    author {
      firstName
      lastName
    }
  }
}

Or:

mutation {
  newBook(
    title: "Java: The Complete Reference, Tenth Edition", 
    isbn: "1259589331", 
    author: 1) {
      id title
  }
}

License

MIT

About

Sample GraphQL server implemented with graphql-java and Spring Boot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%