AtlasGQL - A self-composing GraphQL server library using TypeScript, Express and Apollo Server
Marcello Barile
Posted on November 4, 2021
Before digging into the details, let me first do a very quick introduction to what GraphQL is.
GraphQL is a query language designed to build client applications by providing an intuitive and flexible syntax and system for describing their data requirements and interactions.
GraphQL is not a programming language capable of arbitrary computation, but is instead a language used to make requests to application services that have capabilities defined in this specification.GraphQL does not mandate a particular programming language or storage system for application services that implement it. Instead, application services take their capabilities and map them to a uniform language, type system, and philosophy that GraphQL encodes.
This provides a unified interface friendly to product development and a powerful platform for tool-building.
spec.graphql.org/October2021
My journey with GraphQL started when its adoption was still surrounded by some skepticism; at that time there were not many tools like today, things as code generators and command-line utilities so having to design and write the GraphQL schema, the resolvers, the logic behind (DTOs, models), the TypeScript definitions, the fragments, etc… was not the best developing experience and since our life timespan is too limited to deal with poorly optimized processes I started working on something to simplify a bit my daily job.
Thankfully there was already something to ease the pain and that thing was Apollo Server but most of the boring and plumbing stuff was still there…
at that point, I began working on something that the community later described as a "code-first approach".
In the GraphQL context, a code-first approach expects you to write your business logic (with types, resolvers, queries, mutations, …) before and only after deriving the schema. TypeGraphQL was crucial for such a thing.
It was only a matter of putting the pieces together, organizing the gears, and hiding most of the complexity under the hood.
A few years later that private "boilerplate" started looking like a kind of a product, that's where AtlasGQL was born.
AtlasGQL is an npm package that comes with the GraphQL (v15) engine, Apollo Server (v3), and Express (v4) already organized having in mind the simplicity of use without compromising the performances.
It's highly customizable and expandable and, in case you are interested, don't hesitate to browser the public repository and the demo application.
The project is open source and every contribution will be highly appreciated.
Posted on November 4, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 4, 2021