Method: GraphQL::Schema::Member::HasDirectives#directive

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

#directive(dir_class, **options) ⇒ void

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.

This method returns an undefined value.

Create an instance of dir_class for self, using options.

It removes a previously-attached instance of dir_class, if there is one.



22
23
24
25
26
# File 'lib/graphql/schema/member/has_directives.rb', line 22

def directive(dir_class, **options)
  @own_directives ||= []
  HasDirectives.add_directive(self, @own_directives, dir_class, options)
  nil
end