|
|
|
|
|
by RussianCow
4005 days ago
|
|
> Imagine a simple case where you're storing hundreds of records of users, and providing the flexibility to order by any field on the user... You don't have to allow ordering by any field. You can define a list of fields that you can order by, and only allow those. I don't see the problem with doing that. But if you must allow ordering by any field... > Did you just create database indexes to support each of those use cases? Ugh. ...then yes, you would need to do that. I think the cool thing about GraphQL (at least from my understanding) is it doesn't necessarily give you full power to query data in any arbitrary way from the client--it just provides a more flexible interface for defining what data you want returned from the API and how you want that data structured. It doesn't necessarily have to be a 1:1 mapping of your DB schema, and in most cases I don't think it should be. |
|