graphql

2021-12-07T11:55:19.078600Z

One thing I’d like to do is annotate types, fields and values returned by resolvers and in addition to the graphql data provide an extension in extensions which provides additional metadata mapping fields and some values in the response to additional metadata… I’m assuming the right way to do this is to use directives (or in some cases just additional metadata on the values a resolver returns (e.g. added via clojure metadata or by wrapping values with records/protocols etc); and then provide an interceptor that builds the extension data by walking the final graphql response; and potentially the compiled schema (looking for directives in the subset of TypeSystemDirectiveLocation’s I’ll need). I’m assuming others have done this; does the above sound reasonable and are there any good examples of this kind of thing?

2021-12-07T13:04:35.078700Z

IIRC, lacinia already wraps the values with a record. Maybe you can start from here? https://walmartlabs.github.io/apidocs/lacinia/com.walmartlabs.lacinia.resolve.html#var-with-extensions

👀 1
2021-12-07T14:28:50.079300Z

That’s great, I think it’s exactly what I’m looking for 🙇

👍 1
2021-12-07T04:17:14.070500Z

Anyone tried to integrate Lacinia with duct?

2021-12-07T06:48:36.070800Z

Yeah someone did: https://github.com/kakao/duct-lacinia

👀 1
2021-12-07T13:10:37.078900Z

Thanks. The project does not seems to be maintained. 🥲 https://github.com/kakao/duct-lacinia/issues/1

2021-12-07T17:41:36.081200Z

I know that Lacinia pedestal isn't so much code, so perhaps it isn't as hard as you think it is to bridge lacinia <=> duct

👍 1
2021-12-08T04:18:24.087Z

You’re right. Thanks!