Is it OK to access one database with two endpoints...
# prisma-whats-new
w
Is it OK to access one database with two endpoints, eg with PHP in web app and GraphQL in mobile app? Or should I create one API to use for both web and mobile?
h
Sure, but it would lead to you having to maintain two API’s instead of one, why would you want that?
n
agreed with @halborg, but there is nothing preventing you do do two APIs if it makes more sense in your use case 🙂
h
One of the beauties of GQL is that you no more have to deal with
/api/web/someModel/with-details
and 4 other variants of that endpoint to account for different devices and subtypes of that model - you let the clients decide for themselves 🙂 So sure, you could have two API’s but I’d argue that it would be shooting yourself in the foot 🙂