Skip to content

How to use user directives? #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bronte2k7 opened this issue Mar 10, 2022 · 2 comments
Closed

How to use user directives? #162

bronte2k7 opened this issue Mar 10, 2022 · 2 comments

Comments

@bronte2k7
Copy link

Hi

Most classes have good descriptions and examples. But GraphQLDirective doesn't include any examples. Therefore, there was a difficulty in how to use it?

test = GraphQLDirective(name='test', locations=[DirectiveLocation.QUERY])
schema = GraphQLSchema(query=query, types=[demo_type], directives=[test])

How to apply test directive to query type?

@Cito
Copy link
Member

Cito commented Mar 10, 2022

Hi @bronte2k7

How to apply test directive to query type?

This is deliberately not supported by GraphQL.js (and thus also not by GraphQL-core).

The reasons are explained best in this comment.

@bronte2k7
Copy link
Author

Hi @bronte2k7

How to apply test directive to query type?

This is deliberately not supported by GraphQL.js (and thus also not by GraphQL-core).

The reasons are explained best in this comment.

Thanks for your reply. Сomment helped me)))

@Cito Cito closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants