module Mutations class Create<%= @camelize_name %> <%= "<" %> BaseMutation include Guardian <% for field in @create_mutation_lines %><%=field%> <% end %> type Types::<%= @camelize_name %>Type def resolve(**params) check_authentication! create_<%= @snake_case_name %>(params) end private def create_<%= @snake_case_name %>(params) <%= "#{@snake_case_name} = #{@camelize_name}.new(params)" %> if <%=@snake_case_name%>.save <%=@snake_case_name%> else raise GraphQL::ExecutionError, "Invalid input: #{<%=@snake_case_name%>.errors.full_messages.join(', ')}" end end end end