3 ms·
This is the main reason why I use graphql on my Ruby web projects. The client flexibility is nice. Performance issues from wonky queries sent from clients can b
by rubyist5eva 4y ago
This is the main reason why I use graphql on my Ruby web projects. The client flexibility is nice. Performance issues from wonky queries sent from clients can be a pain to debug - thankfully it’s an internal API so I can work directly with the client devs to create optimal queries. But the strong type guaranties and schema validation is the main reason why I prefer graphql over rails controllers with strong parameters.
- sparker72678 4y agoDo you find the type definition work to be better/easier than using model validations? I’ve found that I prefer that logic in the model instead of type def files, but hey, to each their own, of course.
- rubyist5eva 4y agoI use a mix of both. GraphQL is used to validate the schema and types of the input, model validations are used to ensure that the actual values being saved to the database make sense from a domain perspective.