graphql

defa 2020-08-11T10:12:59.274400Z

In a lacinia resolver function is there a way to get the resolver name from the schema? I’d like to use this for logging and transaction reification. I already have a wrapper function around datomic.api/transact to extract some information from the context/request and like to add the resolver issuing the transaction by passing lacinia’s context to the wrapper.

defa 2020-08-13T09:03:43.000100Z

@hlship that’s reasonable and an API would be much appreciated. Thanks!

hlship 2020-08-13T19:31:25.004500Z

Good chance to provide a patch! Tests expected, of course.

defa 2020-08-11T10:37:00.274900Z

Is it okay to use

(get-in context [:com.walmartlabs.lacinia/selection :field-definition :qualified-name])
or is this some kind of internal/private API?

orestis 2020-08-11T10:37:57.275100Z

I’m fairly certain that there’s a public API for that…

hlship 2020-08-11T16:13:50.275300Z

That's not documented, but it is fairly stable. It would be easy to add an API to do that extraction for you.

hlship 2020-08-11T16:14:29.275500Z

Basically, I don't want to document what Lacinia puts into the context, because future requirements (including performance improvements) may change that structure at some point.