Red Wine

c-sharpnuget

Conceptually, Red Wine is a poor man’s GraphQL for C#. It is open sourced and is available as a nuget package. It was created before GraphQL was a thing.

Notes

“Ambitious undertaking that it was, I got a lot of things wrong in its design and I got some of it right. But hey, look at the name. Like a good wine, the concept did age well in the form of GraphQL.”

React and GraphQL both are unique approaches that changed the course of web development. Notice how I mention that they are approaches because I understand that underneath the implementation, there’s a style of web development that seems natural to most people while not everybody finds it so. The reason why I find it natural is because before I knew about either of them, I was trying to build something like that for myself. I was doing both backend and frontend stuff and I felt how disconnected it can seem for somebody who regularly works at both the ends. I found REST api approach to be limiting because I wanted UI to dictate what sort of data it wanted. I knew a bit about OData but somewhere I felt it wasn’t enough.

So I took the monumental decision to build something along the lines of GraphQL without knowing or setting any expectations. With only 2 years of professional experience behind my back, I was just looking to have some fun. And I managed to build something that quickly became antiquated when GraphQL came along. But it was a good lesson. It taught me to trust my instincts and made me more confident about my programming skills because I felt validated by the advent of GraphQL.

The library makes heavy usage of Reflection (C#) and encourages an declarative mental model wherein data can be fetched by defining a configuration. The response can be flattend if needed with graceful handling of duplicate keys if any.