khamusa / rspec-graphql_matchers

Collection of rspec matchers to test your graphQL api schema.
MIT License
145 stars 49 forks source link

Proposition: add a matcher chain for :method on field definition #36

Open LucDelmon opened 4 years ago

LucDelmon commented 4 years ago

Hello,

Wouldn't it be revelant to add a chain to the matcher have_field to check for the method argument used to link a field to a method on the model ?

field :hello, String, null: false, method: :hello_world

The chain could be called :with_method or :linked_to_method

I don't know if it is in the spirit of the gem since it checks a bit more than just the schema definitions but it could be very useful

khamusa commented 4 years ago

Hi @LucDelmon thanks for the suggestion. I believe it is in the spirit of the gem, since we test to pursue correctness.

Would you be willing to give this feature a try? I'd gladly accept a PR on this.

Sorry for the delay on the response.