sangria icon indicating copy to clipboard operation
sangria copied to clipboard

[Feature Request] Ability to add directives

Open Yomanz opened this issue 3 years ago • 2 comments

I can't see any way to create any directives within a schema.

I tried but I ran into the same issue that has been open for a while.

https://github.com/sangria-graphql/sangria/issues/467 Any help is greatly appreciated.

Yomanz avatar Jun 02 '21 17:06 Yomanz

I might help you here 🤔 there are two parts to consider while using a custom directive. The first part is the definition, for that you use sangria.schema.Directive, as can be seen here. The second part is to actually use the defined directive, and for that you need to use sangria.ast.Directive, here.

xsoufiane avatar Jun 02 '21 18:06 xsoufiane

I might help you here 🤔 there are two parts to consider while using a custom directive. The first part is the definition, for that you use sangria.schema.Directive, as can be seen here. The second part is to actually use the defined directive, and for that you need to use sangria.ast.Directive, here.

I tried this and it didn't seem to apply them to the schema sadly.

Yomanz avatar Jul 19 '21 15:07 Yomanz

https://github.com/sangria-graphql/sangria/discussions/913

yanns avatar Sep 27 '22 19:09 yanns

Fixed by https://github.com/sangria-graphql/sangria/pull/918

yanns avatar Oct 11 '22 14:10 yanns