https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
s

Saharath Kleips

08/27/2020, 5:51 PM
Hi there, does anyone know how I would go about grabbing the requested fields that are from a fragment? I’ve looked into the
DataFetchingEnvironment.selectionSet.definitions
object which seems to be what I want (or at least partially), but it doesn’t appear to contain fields requested from fragments.
d

Dariusz Kuc

08/27/2020, 6:11 PM
haven’t tried it but based on the logic I had to do in the plugin to generate the clients you will need use fragment name from the selection set and then match it against fragment definitions in the query document
s

Saharath Kleips

08/27/2020, 6:13 PM
Got it! Thank you I’ll take a look around
2 Views