How to implement multiple custom schema directives (visitSchemaDirectives) through utils package for v8 ? #6128
-
Note: I have asked this question in graphql-tools repo too just seeing if someone here has encountered the same issue as help would be useful and it is ancillary behaviour I am migrating graphql tools from v7 to v8 and need to update my custom schema directive. in my v7 implementation, I had:
in the apollo and graphql/tools docs the example only highlights how to implement single custom directives for v8:
My question becomes if I had multiple directives, what is considered the standard on implementing it or how would you implement it? I could add another line like this, but the below seems clunky Another thought I had was using a reducer Or is the recommended pattern to just have all the transformers and typedefs mapped to a standard field and just call that ?
But was not sure if any of this is a recommended standard, if this would work or if there is a function that handles this similar logic like visitSchemaDirectives ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I do think this discussion is best had over on |
Beta Was this translation helpful? Give feedback.
-
thanks - yeah this question was definitely meant for graphql-tools but was curious anyone else encountered it here - |
Beta Was this translation helpful? Give feedback.
thanks - yeah this question was definitely meant for graphql-tools but was curious anyone else encountered it here -
anyways I got my answer guess I was on the right track in terms of using reducer - ardatan/graphql-tools#3419