Skip to content

Deserialization of arguments with numbers appears not to work #2611

@TomasBarry

Description

@TomasBarry

Given the following input type:

module Inputs
  class MyInput < Types::BaseInputObject
    argument :some_argument, String, required: true
    argument :some_argument_1, String, required: true
  end
end

The following mutation does not have the arguments deserialized as expected:

module Mutations
  class MyMutation < BaseMutation
    argument :my_input, MyInput, required: true

    type Types::SomeType

    def resolve(my_input:)
      # my_input.some_argument is present, as expected
      # my_input.some_argument_1 is not present
      # instead, it takes the form of my_input.some_argument1
    end
end

The query being used is:

mutation MyMutation(
  $myInput: MyInput!
) {
  myMutation(
    myInput: $myInput
  ) {
    ...
  }
}

Where the variables are:

const body = JSON.stringify({
  variables: {
    myInput: {
      someArgument: 'some string',
      someArgument1: 'some other string'
    }
  }
})

Is this a bug, or is it intended behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions