Project

General

Profile

Actions

Bug #32177

closed

Result key for saved object should not be camel case

Added by Ondřej Pražák over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Steps to reproduce:
1) Have a mutation with a result field that has underscore in a field name

module Mutations
  module MyModel
    class Create < CreateMutation 
      # description, graphql_name, resource_class, argument methods omited
      # make sure result field has more than 1 word, reproducible with :my_model, not reproducible with :mymodel
      field :my_model, Types::MyModel, 'The newly created MyModel', null: true
    end
  end
end

2) Execute mutation, query for the new record attributes in response

mutation MyModel($name: String!) {
  myModel(input: {name: $name}) {
    myModel {
      name
    }
    errors {
      path
      message
    }
  }
}

3) Response will show null even though the record was created

{
  "data": {
    "createMyModel": {
      "myModel": null
      "errors": []
    }
  }
}
Actions

Also available in: Atom PDF