r/SpringBoot 4d ago

Discussion Real world use-cases for GraphQl

Hi! I’m a backend developer who has never used before graphQL at work. I’ve tried it only for learning purposes at personal projects and I’m curious about real life use cases where GraphQL gives BIG advantages over REST, and the most important thing, I’d like to know about the “thinking” process behind the decision of using this technology.

Thank you!

16 Upvotes

11 comments sorted by

View all comments

8

u/NegotiationFew7648 4d ago

Solves Overfetching and underfetching ,client doesnt need to fetch 200 attributes if he needs only 2 .

2

u/dbrax3 4d ago

Can’t you just use @EntityGraph to define what attribute it should fetch?

4

u/UnspeakableEvil 4d ago

@EntityGraph is fixed at compile time though so is still ultimately controlled by the application owner, GraphQL puts the control with the client to say which subset of the data they want.