I know it's late and you might already get a solution but recently I faced the same issue and searched for the solution but couldn't find it. So I resolved it by my way. I think it might be useful for others:
Solution:
You can resolve it by having a connection class; inside "graphql/connection" directory within app directory; like this:
class Connections::EmployeesConnection < GraphQL::Function
description 'Employees Connection'
type Types::EmployeeType.define_connection
end
Now use this class as a superclass for your query/mutation class like this:
# Query class
class Queries::Employees::Index < Connections::EmployeesConnection
def call(obj, args, ctx)
# Do stuff here
end
end
Same for user_index:
# Query class
class Queries::Employees::UserIndex < Connections::EmployeesConnection
def call(obj, args, ctx)
# Do stuff here
end
end
Similarly, you can use the same connection class for other employee queries and mutations; it won't give you an error for a duplicate definition of connection.