docs/lib/tasks/helper.rb
# Place the arguments of the input types on the mutation itself.
# see: `#input_types` - this method must not call `#input_types` to avoid mutual recursion
Place the arguments of the input types on the mutation itself.
see: `#input_types` - this method must not call `#input_types` to avoid mutual recursion
Place the arguments of the input types on the mutation itself . see : ` #input_types ` - this method must not call ` #input_types ` to avoid mutual recursion
def mutations
        @mutations ||= sorted_by_name(graphql_mutation_types).map do |t|
          inputs = t[:input_fields]
          input = inputs.first
          name = t[:name]
          assert!(inputs.one?, "Expected exactly 1 input field named #{name}. Found #{inputs.count} instead.")
          assert!(input[:name] == 'input', "Expected the input of #{name} to be named 'input'")
          input_type_name = input[:type][:name]
          input_type = graphql_input_object_types.find { |t| t[:name] == input_type_name }
          assert!(input_type.present?, "Cannot find #{input_type_name} for #{name}.input")
          arguments = input_type[:input_fields]
          seen_type!(input_type_name)
          t.merge(arguments: arguments)
        end
        return @mutations
      end
def mutations @mutations ||= sorted_by_name ( graphql_mutation_types ) . map do | t | inputs = t [ :input_fields ] input = inputs . first name = t [ :name ] assert! ( inputs . one? , "Expected exactly 1 input field named #{name}. Found #{inputs.count} instead." ) assert! ( input [ :name ] == 'input' , "Expected the input of #{name} to be named 'input'" ) input_type_name = input [ :type ] [ :name ] input_type = graphql_input_object_types . find { | t | t [ :name ] == input_type_name } assert! ( input_type . present? , "Cannot find #{input_type_name} for #{name}.input" ) arguments = input_type [ :input_fields ] seen_type! ( input_type_name ) t . merge ( arguments : arguments ) end return @mutations end
Place the arguments of the input types on the mutation itself.
Place the arguments of the input types on the mutation itself .