DEV Community

Discussion on: Wanna play with GraphQL on an existing database

Collapse
 
danroc profile image
Daniel da Rocha

Quick follow-up after some weeks trying stuff out:

I decided to go all in with putting most of my business logic inside my database (Postgres, versioning using Sqitch), and using Postgraphile as the GraphQL API layer (this guide was essential to get started). I then use the Apollo Client on Vue (vue-apollo) to query and mutate my data.

I'm still in the middle of it, but loving it so far!

Collapse
 
joeschr profile image
JoeSchr

Thanks for posting this

Collapse
 
danroc profile image
Daniel da Rocha

Six months in, I would never look back. Once it "clicks", it is a joy to develop. I ditched Sqitch, though (ashamed to say I still did not implemented a db migration system....), and I am still figuring out how to best test my Postgres functions. However, more and more I rely on Postgraphile's auto-created methods to manipulate data on the server, so testing should be less of an issue in the future.

Thread Thread
 
joeschr profile image
JoeSchr

why did you ditch sqitch? lack of utility? I was looking forward to having finally found someone of continuous DB migration (like in laravel).

what's currently also stopping me from pulling the trigger on this, at some point in the future I maybe will wrap this project into electron to deploy it as standalone. and I'm not sure how lightweight, versatile PostgreSQL is on eg windows...

thanks for further elaborating btw!

Thread Thread
 
danroc profile image
Daniel da Rocha

It just felt it was holding me back on fast iterations, as my DB was relatively simple. My plan was to have a base version with all the tables I needed, then create a base migration and go from there. But I never did the "first migration" in the end. I know this will bite me in the ass later, so it is on my TODO list.

GraphQL is actually quite simple once you get the grips of it. I am also planning on trying to write my own schema in my next project, just for practice. You should give it a try, then maybe use SQLite for your Electron project?

Thread Thread
 
joeschr profile image
JoeSchr

You should give it a try, then maybe use SQLite for your Electron project?

Writing my own schema wouldn't be the problem, but I hope that graphile writes all the CRUD and other boilerplate resolvers for me which I hate to do over and over again