Is the overfetching or underfetching actually an issue with REST? REST also allows you to create Web APIs with queries. You can limit the requests to what you need.
Yeah but lets say i am fetching a collection of users from a database and lets assume we have 100 users so the app has to load and get all of the data and sometimes you may not need all of that data or only need a sub set of it with graphQL you can request what you want and you don't want
But why would you think this cannot be possible with a REST API? It is not unusal to be able to define queries, which can filter and order the results. Maybe you would like to have a look at OData as well. It is just a way to create these Web APIs and offers filters and more.
Well yeah but if you use graph QL it comes right out of the box and also it supports typescript so that a advantage so you can get types checking right out of the box
Maybe I am not understanding how GraphQL in general works, but REST is about how you create a Web API. If you are developing it, you will be able to implement it the way I have described.
What is in this case "Out-of-the-Box"?
Well.....you see in graphQL we can use types to performe a query which is a document high lighting all of the things you need from the db and typescript can be used to type that query document what way you know what data is what and where is it coming from and what are the type for example if a use the spaceX graphQL api i can use types to tell what the type is and thus getting better intellisense also in filtering in db the database is responsible for the filtering each item could be expensive with graph ql you don't need to do this
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
GraphQL is the best way to avoid overfetching data and blocking the application from functioning properly
Is the overfetching or underfetching actually an issue with REST? REST also allows you to create Web APIs with queries. You can limit the requests to what you need.
Yeah but lets say i am fetching a collection of users from a database and lets assume we have 100 users so the app has to load and get all of the data and sometimes you may not need all of that data or only need a sub set of it with graphQL you can request what you want and you don't want
But why would you think this cannot be possible with a REST API? It is not unusal to be able to define queries, which can filter and order the results. Maybe you would like to have a look at OData as well. It is just a way to create these Web APIs and offers filters and more.
Well yeah but if you use graph QL it comes right out of the box and also it supports typescript so that a advantage so you can get types checking right out of the box
Maybe I am not understanding how GraphQL in general works, but REST is about how you create a Web API. If you are developing it, you will be able to implement it the way I have described.
What is in this case "Out-of-the-Box"?
Well.....you see in graphQL we can use types to performe a query which is a document high lighting all of the things you need from the db and typescript can be used to type that query document what way you know what data is what and where is it coming from and what are the type for example if a use the spaceX graphQL api i can use types to tell what the type is and thus getting better intellisense also in filtering in db the database is responsible for the filtering each item could be expensive with graph ql you don't need to do this