Fork me on GitHub
#graphql
<
2022-03-29
>
vlaaad09:03:50

Check this out! Iā€™m implementing batching query executor on top of lacinia to solve N+1 problem that works by analyzing selections-tree

šŸ˜ 3
šŸ‘ 4
1
vlaaad17:03:31

This is for open source project, so it's possible I'll release it as a separate library

vlaaad17:03:18

2 weeks of thinking, 2 days of typing, 200 lines of code %)

hlship18:03:15

Color me interested. Could this be implemented using GraphQL directives rather than wrapping the entire tree?

vlaaad18:03:52

I don't know what is GraphQL directives šŸ˜„

vlaaad18:03:57

Do directives in lacinia affect selections-tree output?

hlship22:03:48

Directives are annotations that can be placed on various schema and query document elements, for example, @deprecated. In the schema, you can associate code that can "wrap" a resolver function with your own function.