3 ms·
> It's called REST APIs and we've known how to do them since 2001. The aim of GraphQL insofar as I understand it is that instead of having to develop two thing
by Cthulhu_ 9y ago
> It's called REST APIs and we've known how to do them since 2001.
The aim of GraphQL insofar as I understand it is that instead of having to develop two things (a front-end and a back-end REST API that talks to your database or other services), you need just one (a front-end that talks to GraphQL). Mind you, graphQL becomes the back-end-for-front-end then, and will still need a lot of work. The main point is that with GraphQL you'll only need one for all of your apps, while traditionally you'd write one REST API for each client.
- dmitriid 9y ago> you'd write one REST API for each client. Erm... What? Granted, web requirements are a bit different from mobile requirements, but still. Why would you write one REST API for each client?
- jacobr 9y agoBecause requirements are different. Our admin GUI needs much more data and different access controls than our web and mobile apps. Third party consumers have even more different requirements. We never need to bikeshed with developers from all other teams to make sure things are consistent or whatever. We generate endpoints from a Swagger spec. With good abstractions it is not much work. Frontend devs do modifications to these endpoints as well since they are so trivial.
- dmitriid 9y ago> Because requirements are different. Our admin GUI needs much more data and different access controls than our web and mobile apps. Indeed. And how does GraphQL solve the need for different data and different access controls to that data? :)
- jacobr 9y agoNot sure, I haven't seen a good story for it. We'll stick with REST.
- brycesteinhoff 9y agoI don't think APIs in general should have anything to do with authorization, other than passing along a token.
- kazagistar 9y ago> you'll only need one for all of your apps, So where are my clients for statically typed languages? I looked into GraphQL and promptly dropped it cause I couldn't seem to call into it from Java in any sensible way. If all your "apps" are javascript, maybe this is true, but that hardly makes it a universal technology.
- jamesmp98 9y agolol it's 2017 use JS for everything you pleb
- lomereiter 9y agoIt could have better documentation but here's the Java client for Android: https://github.com/apollographql/apollo-android https://github.com/apollographql/apollo-android There's also a Swift client available: https://www.apollographql.com/docs/ios/ https://www.apollographql.com/docs/ios/
- kazagistar 9y agoThat looks pretty decent indeed, and makes me a lot more hopeful about the promises of GraphQL, but it sounds like its an Android specific implementation, rather then something I could actually use for JVM service-to-service communication.