api design – Is there anything that rest APIs can do that GraphQL still cannot do?
I just started learning about the specification, but I still have some doubts about why GraphQL simply hasn’t replaced REST since it was created.
REST APIs are very inflexible and straightforward. This ends up causing some problems that don’t exist with GraphQL. I don’t know if my perception of GraphQL is completely wrong, but it seems a bit wrong to create REST APIs, because you’ll often have an inflexible endpoint with data you don’t need, and you’ll have to deal with problems like n + 1 and have to create those aberrations like /api/user-and-posts. With GraphQL, everything is simpler; you get what you need, and if you don’t have it, just create it with simple schemas. There’s no excess data, no extra data, just what you need. The database and backend will consequently experience less pressure, and things will flow more smoothly. We would create only the necessary schemas, perhaps an abstraction layer for the database, but still keep it simple.
I’m asking here because I haven’t actually used this technology in the field yet, so I don’t know its roles outside of small projects. I’m wondering if there’s something else that makes REST still useful, or if there’s some issue with the specification.
Read more here: Source link
