Closed robCrawford closed 5 years ago
@robCrawford Thanks for bringing union type into this lib. About the child argument feature, I have considered to add similar implementation like yours, but there is an issue if two fields have the same argument names. For example:
mutation signup($email: String!, $username: String!, $password: String!, $count: Int, $count: Int){
signup(email: $email, username: $username, password: $password){
token(count: $count)
user{
id
username(count: $count)
email
createdAt
context{
user{
id
username(count: $count)
email
}
domain
}
}
}
}
What do you think about it?
Hi @timqian, thanks for your great work on this. I thought i'd fixed this issue already... I will take another look.
The only solution I can see is to prefix the var with its parent field name... seems to work well enough for my current tests.
Thanks, @robCrawford This solution is not perfect but better than current behavior.
@robCrawford I reverted the code to the first version you suggested and published to npm (in this commit 6250299), the reason is prefixing did not fully resolve the issue I mentioned above and brings compatible behavior to the earlier version
Adds union type support. Adds child argument declarations to query. Fixes bug where child query had no fields i.e. empty braces. All working so far on a fairly large schema!