GraphQL multi-part request spec outlines a specification for multipart form requests in GraphQL. Jayden Seric, the author of the spec, has also authored two libraries apollo-upload-client and apollo-upload-server which makes it effortless to integrate file uploads in Apollo Server.
GridFS is a simple file system abstraction on top of MongoDB. This facilitates storage of large files (beyond BSON document size limit) in mongo database.
This post outlines the minimal integration required to save the files uploaded through the GraphQL API to GridFS.
Continue reading Uploading files to MongoDB GridFS via Apollo powered GraphQL API
It is fairly straightforward to add a GraphQL API powered by Apollo Server to a Next.js application through a koa middleware.
The abbreviated snippet below summarizes the setup along with the libraries involved:
Continue reading Integrating Next.js, Apollo Server and Koa
Usage of C# inspired
Most of the times we
await on promises (typically returned from async functions), however, it is relatively less well known that
await works on arbitrary thenables. By thenables we mean any object with a
then function member.
This post covers this usage, and explores some scenarios where it can be interesting.
In past developers have often relied on backend-specific toolchains for web application frontends. Some examples would be Rails asset pipeline or the legacy ant based toolchain for YUI. However recently node.js based tooling support for frontend technologies has significantly evolved and it is quite viable to use a node.js based toolchain for managing your frontend projects, even if the backend is not node.js, thus keeping the workflow decoupled from the backend.
One of the biggest promises of Node.js is code re-use across client and server – this post focusses on reusing server side templates on client as well for dynamic rendering.