17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/kanji/graph/register_mutation.rb', line 17
def call
return_type = self.return_type
attributes = self.attributes
name = self.name
description = self.description
resolve_proc = self.resolve
coercer = Graph::CoerceType
GraphQL::Field.define do
type -> { return_type }
name name
description description
attributes.each do |attribute|
argument(
attribute.name,
coercer.(attribute.type),
attribute.description
)
end
resolve resolve_proc
end
end
|