Fork me on GitHub
#graphql
<
2020-09-25
>
mafcocinco01:09:35

Will this allow a resolver to know the name of the field it is resolving? More importantly, is there a public interface for determining that right now? I have situation where the same resolver is used for 2 different fields on container object and need to be able to differentiate which field is being resolved.

hlship21:09:44

Yes, it will. You can get the field name, alias name, argument values, field directives, field type (and directives on that and its sub-fields).

hlship21:09:41

it’s all behind protocols, so you have perhaps a better idea of what you can do: https://github.com/walmartlabs/lacinia/pull/335/files#diff-d733257ec2fb4772d623a165b8236ae2

hlship21:09:56

Though the trick is to know which instances implement which protocols, of course.

hlship21:09:05

It will be easy-ish to add further protocols to get at even deeper data, if needed.

mafcocinco02:09:03

Sweet. Any thoughts one when that will be rolled out for general use?