Different types of webservices

Viewed 73

Main types of web services that I am finding online are:

  • SOAP web services
  • RESTful web services

My question, and it might be very dumb is, why GraphQL isn't mentioned in any answers when types of web services are mentioned?

1 Answers

GraphQL is from Facebook and it provides an alternate solution for web service APIs. Basically, it is a query language for Web APIs. It is not a web service. It has advantages over REST and has other additional features. GraphQL is bit lightweight than SOAP and SOAP is a standards-based web services access protocol.

Unlike REST, the GraphQL enables a solution to avoid multiple round trips to the server by having one request in scenarios where you may need to make multiple round trips to server and also GraphQL can be used such that to fetch the needed data only and thereby solves the "over-fetch" and "under-fetch" problems of client which in-turn helps in system performance improvement.

GraphQL is intended to represent data in a graph(collection of nodes and edges represent the business domain) using a GraphQL schema language and avoids the usage of the columns and rows as in typical RDBMS. This schema in-turn helps in bridging the gap between the front-end and back-end developers.

GraphQL however has challenges in server-side caching as in the REST, the data structure will be same, but in GraphQL, there might not be clarity on the client request ahead as it will be more specific to operation.

Related