You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If githubkit included the most recent GQL schema, it could pre-validate queries and make sure that the right variables (including their types) are passed in when querying.
The library should also make it possible to apply optimisations to the passed in query (such as AST-based minification, resulting in less network bandwidth and more efficient queries. The AST also tells you if the input query supports pagination (and where in the response to find the cursor information, and what the cursor argument name is).
The text was updated successfully, but these errors were encountered:
Validating the query may prevent making wrong requests, but, I think this should be done in your development stage. Query validation (including variable validation) should not always happen in the production env (runtime). Queries are literal strings in most cases. Including schema validation will also increase the complexity of the code. GitHub's public schemas are not always correct 🫠.
For AST-based query operations, parsing it and walking through AST (every request) also takes a lot of times (do this in python is really slow).
Fair enough. I was thinking about this as dev-time support, but you may as well then use a dedicated project (e.g. along ariadne-codegen, but with some more tooling to make it output code that uses githubkit as the client).
It seems ariadne-codegen is a powerful graphql code generator. But i'm not quite familiar with it.
As the example in the readme, we can replace the client into githubkit and find a way to turn the query object into string that can be passed to the githubkit graphql method. This can be an additional tool that wraps githubkit's functionality.
The graphql-core library can validate GraphQL query strings against a known schema.
If githubkit included the most recent GQL schema, it could pre-validate queries and make sure that the right variables (including their types) are passed in when querying.
The library should also make it possible to apply optimisations to the passed in query (such as AST-based minification, resulting in less network bandwidth and more efficient queries. The AST also tells you if the input query supports pagination (and where in the response to find the cursor information, and what the cursor argument name is).
The text was updated successfully, but these errors were encountered: