New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get Proto object from the parent arguments? #91
Comments
Seems like this is working, but I'm not sure if its ideal:
And then in the child field resolver:
Note that this code examples are in Kotlin. |
Hi Maybe I'm misunderstanding but to me it feels wrong that the resolution of Could it be that I'm trying to solve a similar problem myself a.t.m. I'm using a hierarchy of implicitly retrieved context, well known variables and explicit parameters to solve that but I'm not sure what is "the right way" here... |
Hello,
According to the GraphQL specs, this scenario should be possible. That a child inherits arguments from its parent.
Exactly,
I was also thinking to just add this requirement directly on the field, but then the client needs to duplicate this argument, which I would rather avoid. I've solved it by setting |
Hello,
I can't seem to find a way how to access current field parent arguments, and getting the actual resolved Proto object.
For example, we have this query:
Now, field
specificProperty
is aSchemaModification
kind of field, and we need the$input: Input_proto_request_params
variable to be able to resolve it.I found a way that by injecting
DataFetchingEnvironment
in the method we could get the list of parent arguments, like:but with this, I get the
LinkedHashMap
, not the converted to Proto class object. I could create the Proto object manually, but that means the same object is constructed two times.Is there a way to get access to the parent argument, but the already resolved Proto object one?
Thank you
P.S. Love the library, thank you very much for this awesome product ❤️
The text was updated successfully, but these errors were encountered: