Another question - is it possible to specify addit...
# graphql-kotlin
m
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
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
Thanks, will follow-up on the thread above
j
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
Great, thanks for sharing this.