Sha256: bf436d6a37696c38bd5f40c3bb3ffbb0a6a99a2bca0c5d0f08e386b095a1155c

Contents?: true

Size: 557 Bytes

Versions: 11

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

# Comment
module Mutations
  module Admin
    class <%= class_name %>s::Update<%= class_name %> < BaseAdminMutation

      type Types::Admin::<%= class_name %>Type

      def resolve(id:, **args)
        <%= class_name.underscore %> = <%= class_name %>.find(id)
        if <%= class_name.underscore %>.update(args)
          <%= class_name.underscore %>
        else
          context.add_error(GraphQL::ExecutionError.new(<%= class_name.underscore %>.errors.full_messages.join(', ')))
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
graphql_scaffold_fan-0.3.3 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.3.2 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.3.1 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.3.0 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.9 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.8 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.7 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.6 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.5 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.4 lib/generators/templates/mutation_update.haml
graphql_scaffold_fan-0.2.3 lib/generators/templates/mutation_update.haml