/spring-graphql

Build a graph api using spring boot

Primary LanguageJava

GRAPHQL WITH SPRING-BOOT

Description

This project named spring-graphql is an api that uses graphql technology. The main target is to use graphql which is a query language to retrieve data from a server. It is as an alternative to REST, SOAP or gRPC. The api exposes data about books and authors.

Usage

  • Clone the project from GitHub to your machine
    git clone https://github.com/Tountoun/spring-graphql.git
  • Move to the project directory
    cd spring-graphql
  • Install dependencies using maven
    mvn clean install
  • Run the project on your IDE (IntelliJ IDEA for example) or using command
    mvn spring-boot:run

Features

Note: The schema of the response is specified by the client. This avoids over-fetching and under-fetching.
  • Get list of books

  • Get a book by its id

  • Search a book by its attribute; it is or search. The search keys are title, pages, authorName and nationality.

  • Update a book.

  • Delete a book

  • Save a book

  • Get book by isbn
  • Get all authors
  • Get author by id
  • Search authors by using email, name, nationality attributes (they're optional); it is a or search.
  • Update author
  • Delete author (books related to him / her are deleted)
  • Get author by email

Documentation

  • Here is the official documentation of spring for graphql --> check it
  • The documentation of graphql --> graphql.org

Contact