Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare with genqlient #3

Open
hgiasac opened this issue May 3, 2024 · 1 comment
Open

compare with genqlient #3

hgiasac opened this issue May 3, 2024 · 1 comment

Comments

@hgiasac
Copy link

hgiasac commented May 3, 2024

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:

  • Designed for Hasura GraphQL with a built-in builder for CRUD operation.
  • Dynamically select required fields, can reuse the struct for many operations and relationships.

Meanwhile genqlient is more type-safety. It can generate GraphQL operations from .graphql files and validate them with the schema on the server.

@imperfect-fourth
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants