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

Using guard in base/parent class always takes priority #51

Open
chrise86 opened this issue Nov 10, 2021 · 1 comment
Open

Using guard in base/parent class always takes priority #51

chrise86 opened this issue Nov 10, 2021 · 1 comment

Comments

@chrise86
Copy link

chrise86 commented Nov 10, 2021

If using guard ->(obj, args, ctx) { some_method } inside a base type class, and then inheriting from that class you cannot specify overrides per sub class or even per field. It will always use the guard from the parent class.

class ParentType < BaseType
  guard ->(obj, args, ctx) { false }
end

class ChildType < ParentType
  guard ->(obj, args, ctx) { true } # will not work

  field :id, ID, required: true, guard ->(obj, args, ctx) { true } # also will not work
end
@nick-benoit14
Copy link

Yeah i'm also confused by this. It would be nice to be able to have a guard like

  guard ->(obj, args, ctx) { false } 

In my base type so that I can verify everything has a guard.

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