Skip to content

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

Description

@chrise86

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions