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
Hi there! Thank you very much for this awesome package! I am new to GraphQL and tried before a package from rebing, but you package seems to be more fresh and your features are simple crazy awesome!
When I tried your library, it was important to me, that all relationships loads eager. As you provide transformers, I didn't even need to write a query for testing this out - nice! BUT exactly there I found a bug.
I would like to fix it, but I don't feel much confidence with your code, as I see at it since 1 hour. So I just describe the problem ;)
In file StudioNet\GraphQL\Support\Transformer\Transformer.php in method getResolverCallable() you tries to guess the relations with $this->guessWithRelations($definition, $fields). For ViewTransformation (and all other mutation-transformations) it works perfectly. Relations are guessed correctly, as fields at the root contains exactly the structure of queried type.
But to query data via ListTransformer, we have to use query like this:
{
items {...}
}
So in getResolverCallable() the variable $fields contains that, what was given (same as in example).
When you then call $this->guessWithRelations($definition, $fields), variable $fields contains wrong attributes, better saying it contains correct attributes, but inside items{...}. So the guessWithRelations() guesses, there are no relations at all, because it checks only items field.
I know, you have a TODO there (Improve this checker). If you wish, I could try to improve it.
P.s. Child-relations are also not guessed.
The text was updated successfully, but these errors were encountered:
Hi there! Thank you very much for this awesome package! I am new to GraphQL and tried before a package from rebing, but you package seems to be more fresh and your features are simple crazy awesome!
When I tried your library, it was important to me, that all relationships loads eager. As you provide transformers, I didn't even need to write a query for testing this out - nice! BUT exactly there I found a bug.
I would like to fix it, but I don't feel much confidence with your code, as I see at it since 1 hour. So I just describe the problem ;)
In file
StudioNet\GraphQL\Support\Transformer\Transformer.php
in methodgetResolverCallable()
you tries to guess the relations with$this->guessWithRelations($definition, $fields)
. For ViewTransformation (and all other mutation-transformations) it works perfectly. Relations are guessed correctly, as fields at the root contains exactly the structure of queried type.But to query data via ListTransformer, we have to use query like this:
So in
getResolverCallable()
the variable $fields contains that, what was given (same as in example).When you then call
$this->guessWithRelations($definition, $fields)
, variable$fields
contains wrong attributes, better saying it contains correct attributes, but insideitems{...}
. So theguessWithRelations()
guesses, there are no relations at all, because it checks onlyitems
field.I know, you have a TODO there (Improve this checker). If you wish, I could try to improve it.
P.s. Child-relations are also not guessed.
The text was updated successfully, but these errors were encountered: