@@ -87,6 +87,33 @@ def arguments(owner, ctx); owner.arguments(ctx); end
8787 end
8888 end
8989
90+ class NullWarden
91+ def initialize ( _filter , context :, schema :)
92+ @schema = schema
93+ # TODO consider per-query caches even though there's no filtering
94+ end
95+
96+ def visible_field? ( field_defn , _ctx = nil , owner = nil ) ; true ; end
97+ def visible_argument? ( arg_defn , _ctx = nil ) ; true ; end
98+ def visible_type? ( type_defn , _ctx = nil ) ; true ; end
99+ def visible_enum_value? ( enum_value , _ctx = nil ) ; true ; end
100+ def visible_type_membership? ( type_membership , _ctx = nil ) ; true ; end
101+ def interface_type_memberships ( obj_type , _ctx = nil ) ; obj_type . interface_type_memberships ; end
102+ def get_type ( type_name ) ; @schema . get_type ( type_name ) ; end
103+ def arguments ( argument_owner , ctx = nil ) ; argument_owner . arguments ( ctx ) . values ; end
104+ def enum_values ( enum_defn ) ; enum_defn . enum_values ; end
105+ def get_argument ( parent_type , argument_name ) ; parent_type . get_argument ( argument_name ) ; end
106+ def types ; @schema . types ; end
107+ def root_type_for_operation ( op_name ) ; @schema . root_type_for_operation ( op_name ) ; end
108+ def directives ; @schema . directives . values ; end
109+ def fields ( type_defn ) ; type_defn . fields ; end
110+ def get_field ( parent_type , field_name ) ; @schema . get_field ( parent_type , field_name ) ; end
111+ def reachable_type? ( type_name ) ; true ; end
112+ def reachable_types ; @schema . types . values ; end
113+ def possible_types ( type_defn ) ; @schema . possible_types ( type_defn ) ; end
114+ def interfaces ( obj_type ) ; obj_type . interfaces ; end
115+ end
116+
90117 # @param filter [<#call(member)>] Objects are hidden when `.call(member, ctx)` returns true
91118 # @param context [GraphQL::Query::Context]
92119 # @param schema [GraphQL::Schema]
0 commit comments