The error I'm getting is:
NoMethodError Exception: protected method `new' called for Connections::MySubclassConnection:Class
I've implemented a BaseConnection < GraphQL::Types::Relay::BaseConnection
in base_connection.rb
and then created a subclass class Connections::MySubclassConnection < Types::BaseConnection
in my_subclass_connection.rb
.
This error is being raised in my root query in the connection field:
field :my_subclass_connection, ...
def my_subclass_connection
Connections::MySubclassConnection.new( <--- error is being raised here
Connections::MySubclassItems.new(
...
),
)
end
Add to your Connections::MySubclassConeection something like
But before you do this, check the docs of
Types::BaseConnection
whether they expect you to do something particular in your constructor before invoking the one of the base class.