One full-stack to rule them all!

# A list of edges.

edges: [TodoEdge]}# An edge in a connection.

type TodoEdge { # The item at the end of the edge node: Todo # A cursor for use in pagination cursor: String!}If we’re using Apollo offset based pagination (assuming you have a SQL database this is straightforward), then we just need the Todo type and we pass the limit and offset in the query.

The downside is that if new items are inserted or deleted in the original set it can return duplicates or skip results.

Cursor based pagination fixes this.

This a simple comparison between Relay and Apollo.

For Facebook, Relay’s additional complexities make sense for performance and data guarantees.

For us, the added complexity didn’t make sense but it’s something we could revisit.

Relay TypeScript Todo example for comparison (linked from the official docs)Why Node?Our requirement for a single language across client and server limits our server language choices.

Node has some “regrets” like security, the build system, and package.

json but, the ecosystem is unparalleled.

Node is by far the most popular language on GAE and AWS Lambda.

It’s great for rapid development.

However, many companies also use Node at scale in production (Instagram, Netflix, Airbnb, and Walmart).

Is there something else that can run TypeScript on the server safely in production?.Unfortunately, Deno (from the creator of Node) isn’t there yet.

ConclusionsWhile there is never truly one stack to rule them all, we believe that our set of requirements likely matches many people building web apps today.

While all of these pieces have been battle tested individually the sum of their parts creates a relatively novel way of developing web apps that isn’t currently well documented.

Try it out and let us know what you think in the comments below!.. More details

Leave a Reply