Open gienec opened 5 years ago
@gienec I too need support for aliases. Do you have a suggestion for a backwards compatible way to support aliases?
A while ago, I made an attempt to use aliases in this library, but decided to go a different route for my particular use case. Perhaps one way to solve this is by adding a second exported function called graphQLAliases
, which would call an internal function similar to getAST
, but return the aliases instead of the field names.
See this abandoned PR for some ideas: https://github.com/robrichard/graphql-fields/pull/8/files
@robrichard, could you review this PR #31 ? It does what I need.
@gienec, I don't plan on adding support for aliases as it cannot be cleanly supported with the current API. I'm working on a replacement library with a new API that will correctly support arguments and directives. See the discussion here: https://github.com/robrichard/graphql-fields/issues/27
Request example:
This will return only second field
subField
with argument which value is 2.