Skip to content
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

Document: Adding custom directives #1021

Closed
jkimbo opened this issue Jun 24, 2019 · 7 comments
Closed

Document: Adding custom directives #1021

jkimbo opened this issue Jun 24, 2019 · 7 comments
Labels

Comments

@jkimbo
Copy link
Member

jkimbo commented Jun 24, 2019

It is possible to pass custom directives to graphql-core but it's not documented anywhere. It should be.

from graphql.types.directives import specified_directives  # <== default directives
from graphene import Schema

schema = Schema(query=Query, directives=specified_directives + [MyDirective])

@skip and @include and defined here: https://github.com/graphql-python/graphql-core/blob/8f7c8f3351dd0a4580b87f293aed7bfcf9126bc4/graphql/type/directives.py#L69-L98

Originally raised in #1006

@stale
Copy link

stale bot commented Aug 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 23, 2019
@stale stale bot closed this as completed Aug 30, 2019
@jkimbo jkimbo reopened this Sep 20, 2019
@stale stale bot removed the wontfix label Sep 20, 2019
@stale
Copy link

stale bot commented Dec 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 19, 2019
@stale stale bot removed the wontfix label Dec 26, 2019
@beneshed
Copy link

beneshed commented Jan 1, 2020

Also is there anyway to add a directive to a field via field argument? in an ObjectType definition

@beneshed
Copy link

beneshed commented Jan 1, 2020

This looks like directives are only supported client side and not server/query side

@beneshed
Copy link

beneshed commented Jan 1, 2020

Sorry for being an idiot, this was already discussed #1006

@stale
Copy link

stale bot commented Mar 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 31, 2020
@stale stale bot closed this as completed Apr 14, 2020
@karlosss
Copy link

karlosss commented Oct 9, 2020

Is it possible that the documentation on writing custom directives is still missing, or I am just unable to find it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants