graphql-weaver icon indicating copy to clipboard operation
graphql-weaver copied to clipboard

Directives, especially and primarily, default ones, get duplicated for each schema

Open nyteshade opened this issue 7 years ago • 1 comments

Is there a particular reason why directives are duplicated. Given the Facebook Reference implementation, there is no way to specify a resolve function for a directive. Furthermore all attempts to do so, do so by wrapping all field resolvers with additional logic that checks the astNodes for attached directives.

Can we dedupe the directives?

nyteshade avatar Feb 25 '18 05:02 nyteshade

In the general case, directives can't just be deduplicated by their names - descriptions and arguments might differ. This is similar to #13 (deduplication for types).

I agree with you however that the specified directives (include and skip) should be deduplicated by default. -> I'll tag this one as bug for the duplication of specified directives, but for custom directive deuplication, we would need an API first.

Yogu avatar Mar 05 '18 23:03 Yogu