GraphQL Ruby 'Duplicate type definition found' error
Asked Answered
U

0

7

I'm trying to update my mutation with variables and receive such error:

Duplicate type definition found for name 'SignInInput' at 'Input field SignInInput.signInInput'

My mutation code:

module Mutations
  class SignIn < BaseMutation
    description 'User sign in'

    argument :signInInput, Inputs::SignInInput, as: :sign_in_input, required: true

    field :token, String, null: false

    def resolve(sign_in_input:)
      ...
    end
  end
end

My custom input code:

module Inputs
  class SignInInput < Types::BaseInputObject
    description "Attributes for user sign in"

    argument :email, String, "User email", required: true
    argument :password, String, "User password", required: true
  end
end

My query:

enter image description here

What can be the reason of this weird error? I have only once defined such class.

Udometer answered 6/2, 2019 at 11:35 Comment(1)
Why is the argument capitalized? Can you just keep the argument as follows: argument :sign_in_input, Inputs::SignInInput, required: trueEncourage

© 2022 - 2024 — McMap. All rights reserved.