-
Notifications
You must be signed in to change notification settings - Fork 0
Home
amberpan edited this page May 3, 2020
·
5 revisions
Traditional REST APIs are difficult to maintain when you have frequently changing requirements. Web APIs may end up serving too much or too less data.
Another limitation with REST API is, if client needs to fetch multiple resources, it has to make multiple calls OR server has to introduce new API which combines multiple resources and sends to client which client may not always require.
GraphQL provides the flexibility to client to choose what it needs. It also provides the ability to fetch multiple resources in a single API call.
- JDK
- IDE(IntelliJ/Eclipse/Any)
-
Use spring initializr to quickly setup sample project with all necessary dependencies(https://start.spring.io/).
-
For GraphQL, add below dependency:
Maven:
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
<version>7.0.1</version>
</dependency>
Gradle
implementation 'com.graphql-java-kickstart:graphql-spring-boot-starter:7.0.1'