#Code-first Go SDK
1 messages · Page 1 of 1 (latest)
Roger that
Have you scouted any useful libraries?
I got a bunch of suggestions here: https://twitter.com/solomonstre/status/1570671152611336194?s=46&t=rOmzYFNkIGyb-wU_UiBH3g
If I wanted to write a custom tool that generates a graphql schema, what libraries should I use? Ideally in go.
There's a few in Go, but they're meh at best: https://github.com/samsarahq/thunder
No, I was thinking of starting more from what the end experience should look like for the users (like the experiments you were doing last week) and then start backfilling the actual implementation from there.
Mostly because like Andrea said the existing go frameworks are not promising
I think due to the fact that our use case is so much more specific we can do better than any of the existing frameworks too
There's a good library in Python (https://strawberry.rocks) and there must be stuff in TS as well
Oh
Also, depends what you mean by code first
client or server
Yeah those would be sort of my inspiration, basically can we get something in Go that looks sort of similar to that where you are just defining structs w/ methods. End result should be that for simple cases it really just looks like you are defining structs and methods like you normally would in go. Really specific graphql stuff only becomes apparent in more advanced use cases
I think we are talking about extensions, so I suppose "server" (even though extensions aren't really servers anymore obviously)
I'm just looking for a good library to generate valid AST and format it to a .gql file.
Everything else will be custom logic (with native go introspection on the other end)
Makes sense that the existing frameworks aren't a good fit for us, they cover a pretty different (and broader) use case
Yeah for that the one that looks interesting from the twitter thread is this: https://github.com/wundergraph/graphql-go-tools
Otherwise I saw the vektah parser I mentioned earlier, which seems like a good choice
It's what's use by gqlgen, which is the "premium" go graphql server, so I suppose there's a good chance it's of relatively high quality
Oh, apparently the wundergraph lib uses vektah too: https://github.com/wundergraph/graphql-go-tools/blob/818bc2dd52cd3c5567f616c7bc795f645232e44e/go.mod#L34
Not sure how much it adds on top of it that would be relevant to us (if anything at all, it seems like it does a lot of different things we don't care about)
I think he’s the author of gqlgen