3 ms·
I remember attending a meetup, once, where it was supposed to be a tutorial on GraphQL. I was barely familiar with GraphQL, when I went in, and left, almost exa
by ChrisMarshallNY 4y ago
I remember attending a meetup, once, where it was supposed to be a tutorial on GraphQL. I was barely familiar with GraphQL, when I went in, and left, almost exactly the same.
The tutorial was actually all about a couple of JS libraries that you could use as GraphQL abstractions. I am a Swift programmer, and was a lot more interested in the actual GraphQL interface, which was barely mentioned.
Lot of that stuff, going around...
- bilekas 4y agoPlease... I've already come to the belief that graphQL is black magic. I use it daily. You do raise a another great example with graphQL & sparQL .. I gave up trying to find any low level documentation on it because it was its so abstract from something I knew before, so I just learnt the triplets and felt comfortable to query 'enough'. I use a library now https://github.com/giacomociti/iride https://github.com/giacomociti/iride because I know the owner and could bug him. Other than that it was a black box.
- rad_gruchalski 4y agoThe source code of the black box is open, you can read it. And its tests.
- andsoitis 4y agoYou’ve probably figured it out by now, but for others who may be in a similar position; GraphQL is a specification (with various implementations) and you can read up on the spec here: https://spec.graphql.org/ https://spec.graphql.org/
- bilekas 4y agoCan you explain it like I am 5 ?
- andsoitis 4y agoRaison d'être: https://graphql.org/ https://graphql.org/ Assumes you’ve done some API design, maintenance, and/or usage, to grasp benefits.
- gabereiser 4y agoGraphQL is a spec, not tech. The implementation of it (Apollo for example) is what you are probably after. GraphQL can exist on a multitude of services that support queries with the GraphQL spec. Like SQL, there are many databases that support SQL (in various forms).
- satvikpendem 4y agoExplain the spec, or the tech? Well the spec basically exists because some people at Facebook noticed that it's more efficient for the client to request exactly the data it needs than to have the server send everything and the client has to transform it. Yes, REST could work, but once you have more complex data structures, it becomes harder. For example with a todo list app, if you want a user's todos that are complete, your request might look like /api/todos/$userId/$completionStatus Now if you want the todo titles, completion status, and description, but don't want a field like subtitle, you could send the entire todo from which the client could extract the necessary fields, but why? That's extra data sent over the wire and extra computation done on the client, for basically no real reason. So maybe in your api, you do something like /api/todos/$userId/fields=title&$completionStatus&description Congratulations, you reinvented GraphQL.