huma
huma copied to clipboard
Graphql support
There are no active graphql libraries in golang supporting struct first approach, there was thunder but it is now archived, and from the way huma is built i think it will be able to support graphql, because it defines request's and response's as a struct already.
@birukbelay Huma v1 actually had some basic GraphQL support built-in, but it was difficult to maintain and rather complex code. I'm happy to have someone build a library on top of Huma (and I'll expose anything needed to do so) to add GraphQL support, but for v2 I'm not going to implement this myself. I'm trying to keep Huma small, simple, fast, and maintainable (which is already quite difficult). Happy to work with someone if they want to try to build it.
In the meantime, something like https://www.npmjs.com/package/openapi-to-graphql can be used to generate GraphQL schema and convert GraphQL requests to plain REST, giving you a quick way to slap some GraphQL support in front of your API.