Open keskiju opened 6 years ago
Perhaps we can forget HTTP/2 push for now. The template already includes an empty graphql
container. We should implement two examples with Apollo:
server
container.The graphql
implementation should use the same libs as server
implementation as much as possible. That is, use koa instead of express. This makes future updates easier. And of course, we should also implement a page with React that uses the GraphQL API. Just use the existing posts and files database tables to implement the example, no need to create more db tables. You can add new columns though.
Based on these examples provided by the template you can:
Some people are saying that GraphQL will replace REST altogether in APIs, but it might just be hype, and it's probably best to keep both in your toolbox.
REST with HTTP/2 push might actually prove to be quite fast. If you fetch a list of A's that have references to B's, C's and D's, the API gateway can send you a list of A's immediately and the B's, C's and D's are pushed later once they have been fetched from the other service endpoints. You can also utilize http caching with REST. And it would also be quite trivial for the API gateway to provide a generic property filtering mechanism in case the client only requires a couple of fields from each entity.