Add a helper that can check object type, as well as interfaces.
Checking the exact type is already possible with typename
user.typename == "User"
But there is nothing like is_a or kind_of that can check the type hierarchy.
Looking for naming suggestions. I can't call it is_a or kind_of since those are Ruby builtins. Maybe type_of?
👍 for type_of?. It's consistent with the rest of the GraphQL vocabulary anyway.
Another option would be of_type?, personally that makes a bit more sense to me, eg
At least for me, that's how I say it in plain talk, "object O is of type T"