REDUCING UNDER-FETCHING AND OVER-FETCHING IN REST API WITH GRAPHQL FOR WEB-BASED SOFTWARE DEVELOPMENT - Muzaki, Rizki Nuzul; Salam, Abu (Informatika, Universitas Jenderal Soedirman, 2024)
Rest API is the most popular architectural style in website-based software development. However, Rest API has under-fetching and over-fetching problems. Under-fetching is a situation when the client has to make requests to several endpoints, while over-fetching is a situation when the client receives more data than needed. There is an alternative technology to Rest API, namely GraphQL. GraphQL has the potential to solve both under-fetching and over-fetching problems. This research aims to analyze how quickly GraphQL responds in overcoming under-fetching and over-fetching problems and conducting condition analysis to determine when it is best to use GraphQL. In this research, tests were conducted to answer these problems by applying each of the five test scenarios for under-fetching and over-fetching problems. Test results show that GraphQL can provide response speeds of 36.84% to 93.04% superior to Rest API. In the case of under-fetching, it is best to choose GraphQL when there is a need to call more than four endpoints. Meanwhile, for over-fetching problems, using the Rest API provides adequate response speed. However, if a more optimal response speed is needed, using GraphQL could be an alternative.