Class: Hai::GraphQL::DeleteMutations
- Inherits:
-
Object
- Object
- Hai::GraphQL::DeleteMutations
- Defined in:
- lib/hai/graphql/delete_mutations.rb
Class Method Summary collapse
- .add(mutation_type, model) ⇒ Object
- .add_field(mutation_type, model) ⇒ Object
- .define_create_method(mutation_type, model) ⇒ Object
Class Method Details
.add(mutation_type, model) ⇒ Object
5 6 7 8 |
# File 'lib/hai/graphql/delete_mutations.rb', line 5 def add(mutation_type, model) add_field(mutation_type, model) define_create_method(mutation_type, model) end |
.add_field(mutation_type, model) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/hai/graphql/delete_mutations.rb', line 10 def add_field(mutation_type, model) mutation_type.field("delete_#{model.name.downcase}", "Types::#{model}Type".constantize) do mutation_type.description("Delete a #{model}.") argument(:id, ::GraphQL::Types::ID) end end |