Seaography 2.0: A Powerful And Extensible Graphql Framework 🧭
GraphQL has become the preferred interface for product teams. Both frontend and backend developers benefit from its type-safety, contractual guarantees, and composability. Yet the real challenge lies on the backend: implementing relational resolvers that can traverse complex schemas is often difficult and time-consuming.
Yes, there are libraries that can spin up a GraphQL resolver quickly, but they often come with trade-offs: they're hard to customize, making it painful to add additional endpoints when your application grows beyond the basics.
The hardest challenge is customization. Real-world applications demand fine-grained permissions and context-dependent business logic. Seaography is designed to solve this exact problem, offering:
A video is worth a thousand words, so let's look at a quick demo.
This is of course a speed run, but you can follow the same steps easily, and the generated framework is fully customizable.
The following query finds us all the documentaries starred by the actor "David" along with the stores having it in stock so that we can go rent it.
A data loader is used for resolving the relations, such that it does not suffers from the N+1 problem.
Full CRUD is supported, including CreateOne CreateBatch Update and Delete.
The above is not something entirely new, as some features already exist in Seaography 1.0. The real game-changer is how you can implement custom endpoints and mix-and-match them with SeaORM entities. Let's dive into it!
Seaography 2.0 introduced a set of macros to allow you to write custom query endpoints by reusing facilities in Seaography.
Source: Dev.to