/graphQLapi

graphql API using Spring-boot from DZone reference

Primary LanguageJava

GraphQL API

Rest vs GraphQL

  1. GraphQL can answer to front-end specifying the fields of interest. This improve your performance application.
  2. GraphQL has only one endpoint to provide its resources, while REST use multiple of them.
  3. GraphQL provides only the necessary fields required by your front-end request.

But what is GraphQL?

GraphQL is a query language. It gives control to the user to query what he needs, thus reducing the payload on the network.

Components

  • Schema (Schema Definition Language SDL)

  • Query (GET in REST)

  • Mutations (POST and PUT in REST)

  • Resolvers (Functions to resolve requests)

URL to consume API in local