Closed fibrasek closed 5 years ago
I am having this issue also
If it's helpful to anyone, i've been hacking together my own matchers on my fork here. https://github.com/ericraio/rspec-graphql_matchers/
I am also adding a lot more matchers
These issues have been addressed in the latest releases. Please open a new issue if any of those problems still persists.
Hello guys,
The problem I'm facing is related to this small example:
When I run this teste, I have the following failure:
So I started digging up our code,
rspec-graphql_matchers
andgraphql-ruby
source to find any clues to where thatobject
were being passed and not the actual type.Digging I found out that .of_type actually gets the
type
using#type
on the typeobject or class
(in our case, we're passing theclass
).But
#type
is returning aGraphQL::Schema::NonNull
, not the actualtype
:thinking:So I ran to the
graphql-source
to look in that, and it really returns that instance.And now I'm stuck, and I doing something wrong by defining the
subject
as the class (in our case,Types::Data::Permission
), or is it a bug?Notes:
We are using the
class
definitions as suggested by thegraphql-ruby
gem.The
graphql_spec!
method definition is as follow: