Method: GraphQL::Schema::Member::HasDirectives.add_directive

Defined in:
lib/graphql/schema/member/has_directives.rb

.add_directive(schema_member, directives, directive_class, directive_options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



41
42
43
44
# File 'lib/graphql/schema/member/has_directives.rb', line 41

def add_directive(schema_member, directives, directive_class, directive_options)
  remove_directive(directives, directive_class) unless directive_class.repeatable?
  directives << directive_class.new(schema_member, **directive_options)
end