How to access object variable in visible? method graphql-ruby

267 Views Asked by At

I am trying to hide query class from schema from a user to whom fields are not visible. There are various levels of Users based on permissions. I can use visible?(ctx) method on class level where I have fields visibility is decided based on context. But in some places it is based on the object's column/field value too. How do I access object in the visible?(ctx) method. Or is there any way of globally hiding the class if no fields are accessible(Otherwise the Gquery client throws warnings of No fields defined).

0

There are 0 best solutions below