3 ms·
Do you have good examples of > easily do that with a single aggregation REST endpoint too, provided you have resource links in your responses I work with/on a
by mej10 9y ago
Do you have good examples of
> easily do that with a single aggregation REST endpoint too, provided you have resource links in your responses
I work with/on a "REST" API that has about 20 types of objects, 5-100 fields on each, with many different relationships between them. We've been looking at GraphQL to solve both the querying and mutation aspect, since it is extremely cumbersome to do it efficiently.
GraphQL seems great for this case, but if there is some way just adding resource links could get us most of the benefits I'd love to hear it!
- boubiyeah 9y agoThis is a POC in scala I put together rather quickly: https://github.com/AlexGalays/POC-api-aggregation https://github.com/AlexGalays/POC-api-aggregation How you would write a query: https://github.com/AlexGalays/POC-api-aggregation/blob/master/app/views/index.scala.html#L19 https://github.com/AlexGalays/POC-api-aggregation/blob/maste... Unfortunately the PokeAPI is not the best at showcasing this with many level of unneeded nesting and resources with nothing but an "url" property but hopefully you get the idea :) The fact that the query "language" is indendation based rather than GraphQL's a-string-that-looks-a-bit-like-json-but-isnt was just an arbitrary choice, it's easy to change.