Open hgiasac opened 3 months ago
@hgiasac I am working on a PR that will provide more compile time safety when used with fieldgen
. Instead of having field name constants generated as string
, they will be of type eywa.ModelField[<model>]
. This will ensure that a model's field will be used only for queries of that model. I have some more ideas for more compile time safety.
You're right, genqlient
understands graphql schema and gives complete type safety at compile time. But one place where it lacks is that there's no way to build a query "dynamically". With eywa
you'll be able to do that. You can even build a custom query at runtime.
This GraphQL client seems better than
go-graphql-client
(or shurcooL/graphql) in terms of ORM style. However, it still has some limitations on type-safety. We still need to test the generated query on runtime.The main benefit of eywa over others:
Meanwhile genqlient is more type-safety. It can generate GraphQL operations from
.graphql
files and validate them with the schema on the server.