juancastillo0 / leto

Dart GraphQL server libraries. Utilities, code generator, examples and reference implementation.
https://juancastillo0.github.io/leto/
MIT License
38 stars 6 forks source link

Add "name" to @GraphQLArg decorator #23

Open tigloo opened 6 months ago

tigloo commented 6 months ago

I need to build an API that uses query parameter names which clash with reserved words in Dart, such as "class" or "extension". Due to this, I need to choose an alternative parameter name when declaring the query function but would like to remap it to the original argument name from the GraphQL spec.

Example:

@Query(name: "AccountList") Function<Account?> accountList( @GraphQLArg(name: "class") String? class_ ) {...}