-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Rename @extraTag
directive to @goTag
and make repeatable
#1680
Conversation
Hm, totally missed this great addition from @tprebs (thanks 🙏) I actually like the hook based approach a lot more given the extra flexibility it affords. Partially tempted to revert |
For our use case, I do like the hook based approach more as it allows your directive to be defined more as a behaviour rather than implementation detail. In our case we have a constraint directive (similar to https://www.apollographql.com/blog/backend/validation/graphql-validation-using-directives/) which defines the validation behaviour of the schema. This is abstract enough that we can switch how we do validation by swapping out the hook while the schema remains the same. That being said, not everyone will have the same concerns as we do about abstraction and don't mind exposing implementation detail in the schema. Maybe a middle ground is re-implementing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goTag is much better than "extraTag", but I do think re-implementing it to be applied via a hook would be a good example. Maybe we merge this PR, and make another one to change the implementation to use hooks?
I'm happy rewrite it it using hooks @StevenACoffman unless you want to pick it up @wilhelmeek? |
No, go ahead 😄 I'm a big fan of this middle ground |
Ok, I merged the rename, so @tprebs if you re-write it with hooks, that would be great to get in before a release. Thanks very much! |
Will create the PR first thing tomorrow morning |
@goField
and@goModel
edit: added a comment down below, but contemplating whether it makes sense to have this directive at all given the addition of field-level hooks cc @johnmaguire
I have: