graphql-python / graphql-core

A Python 3.6+ port of the GraphQL.js reference implementation of GraphQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use user directives?

bronte2k7 opened this issue · comments

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?

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.

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)))