变异后反应挂钩更新查询

时间:2020-02-24 15:10:52

标签: reactjs graphql

突变后如何更新查询。应该在不重新加载的情况下进行更新

module ActionView
  module Helpers
    class FormBuilder
          def globalize_fields_for(locale, *args, &proc)
        raise ArgumentError, "Missing block" unless block_given?
        @index = @index ? @index + 1 : 1
        object_name = "#{@object_name}[translations_attributes][#{@index}]"
        object = @object.translations.find_by_locale locale.to_s
        @template.concat @template.hidden_field_tag("#{object_name}[id]", object ? object.id : "")
        @template.concat @template.hidden_field_tag("#{object_name}[locale]", locale)
        @template.fields_for(object_name, object, *args, &proc)
      end
    end
  end
end

1 个答案:

答案 0 :(得分:0)

这应该可以解决问题: const [updatePost] = useMutation(UPDATE_PSP_TASK, POST)