graphql-bookshelfjs icon indicating copy to clipboard operation
graphql-bookshelfjs copied to clipboard

Mutation example

Open paulosuzart opened this issue 7 years ago • 2 comments

Hi,

First, this is awesome work. Really useful lib.

Do you have any mutation example or plan to support this scenario?

paulosuzart avatar Apr 15 '17 06:04 paulosuzart

Hi, So sorry for my late reply. Thank you for using this library and for your feedback. Regarding your question, I'm not sure if does it make sense to provide support for mutations in this library since most mutations have a bit of logic. You can still use mutations as usually you used to do (mainly for updating and deleting items from database). The main purpose of this library is to make it simple, without to much magic, keeping Graphql API open, to integrate Bookshelf models with Graphql with focus on optimizing 'select' queries. Anyway, if you have any ideas/suggestions please let me know! :)

weyoss avatar Apr 26 '17 10:04 weyoss

It's fine. We are using it and it's pretty neat.

Ok, you are right, I started to think exactly the same after opening the issue. But in our use case there 80% of mutations will be a direct save to the database with no custom logic, if any, that would be handled by bookshelf, so a factory for persistence can still be useful. Anyway, you can close the issue, and if we come up with a generic reusable solution for simple save / update / delete, we submit a pull request.

Cheers!

paulosuzart avatar Apr 26 '17 14:04 paulosuzart