From 66e4678a9f7cd3603d0e00ca2895498ad50f7154 Mon Sep 17 00:00:00 2001 From: Ioannis Kolovos Date: Sat, 14 Mar 2020 18:02:00 +0200 Subject: [PATCH] Update create_mutation.rb --- lib/generators/gql/templates/create_mutation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/generators/gql/templates/create_mutation.rb b/lib/generators/gql/templates/create_mutation.rb index 32f5478..424d52c 100644 --- a/lib/generators/gql/templates/create_mutation.rb +++ b/lib/generators/gql/templates/create_mutation.rb @@ -5,7 +5,7 @@ class <%= prefixed_class_name('Create') %> < Mutations::BaseMutation argument :attributes, Types::Input::<%= name %>Input, required: true def resolve(attributes:) - model = <%= name %>.new(attributes.to_h) + model = <%= class_name %>.new(attributes.to_h) if model.save {<%= singular_name %>: model} @@ -14,4 +14,4 @@ def resolve(attributes:) end end end -end \ No newline at end of file +end