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

Martin Brehovsky

11/03/2020, 11:44 PM
Another question - is it possible to specify additional extensions in the response? We are thinking about exposing some additional metadata with the response and the extensions field seems to be the right fit for this. Is there a way to send the extensions with the responses coming from the server?
s

Shane Myrick

11/04/2020, 12:00 AM
Extensions can be specified with the same approach as above by returning a `DataFetcherResult<*>`https://expediagroup.github.io/graphql-kotlin/docs/schema-generator/execution/exceptions#returning-data-and-errors But the probably more common way is to
graphql-java
instrumentations: https://www.graphql-java.com/documentation/v15/instrumentation/
m

Martin Brehovsky

11/04/2020, 12:18 AM
Thanks, will follow-up on the thread above
j

Joe

11/04/2020, 3:29 PM
initially found the graphql-java ExecutionResult api for this not quite straightforward, so if an instrumentation example is helpful, here's one: https://github.com/trib3/leakycauldron/blob/main/graphql/src/main/kotlin/com/trib3/graphql/execution/RequestIdInstrumentation.kt
m

Martin Brehovsky

11/04/2020, 6:46 PM
Great, thanks for sharing this.