Closed snyt45 closed 6 months ago
Hi, did you resolve that ? I'm facing a same kind of issue,
'Found two visible definitions for UserRegistrationInput
: Types::UserRegistrationInputType,'
@Etx17 I’ve solved this by adding graphql_name
in mutation
module Mutations
class Users::SignUp < GraphqlDevise::Mutations::SignUp
graphql_name ’SignUpUser’ # <- HERE
argument :first_name, String, required: true
argument :last_name, String, required: true
def resolve(email:, **attrs)
...
end
end
end
@snyt45 could you please confirm if this is still a problem? I've seen this in the past, but it used to be related to the actual GraphQL gem and I think that was fixed a long time ago. Does it only happen when you change the code and Rails automatically reloads the changes in development?
@mcelicalderon I believe this problem occurred when I used GraphiQL to verify the operation. Now that I am using Altair GraphQL Client and not using GraphiQL, I have not encountered this problem.
Thank you, @snyt45. I'll close this one then. It can be reopened if someone runs into this again
Describe the bug
I have implemented Mutation to sign up users. Changing the content of the mutation argument raises a
GraphQL::Schema::DuplicateNamesError
.If I restart rails, this problem goes away, but if I change the argument content of Mutation again, I get a
GraphQL::Schema::DuplicateNamesError
.Perhaps it is caused by double registration in the following place (sorry if I am wrong). I am not familiar with graphql_devise and would like some help. https://github.com/graphql-devise/graphql_devise/blob/master/lib/graphql_devise/resource_loader.rb#L39
Environment
Steps to reproduce
I am implementing a Mutation that uses graphql_devise to sign up users. I am using GraphiQL to make sure GraphQL works.
The following mutations were performed in GraphiQL.
The following error occurred
Because the argument was incorrect, the argument was corrected as follows.
If I run Mutation again, I get
GraphQL::Schema::DuplicateNamesError
.Expected behavior
GraphQL::Schema::DuplicateNamesError
should be able to register users without generatingActual behavior
Reproducible demo
I also confirmed that the same
GraphQL::Schema::DuplicateNamesError
occurs when mutation_type.rb is set as follows, regardless of graphql_devise.