Method: GraphQL::Execution::Lookahead#selects?
- Defined in:
- lib/graphql/execution/lookahead.rb
#selects?(field_name, selected_type: @selected_type, arguments: nil) ⇒ Boolean
True if this node has a selection on field_name.
If field_name is a String, it is treated as a GraphQL-style (camelized)
field name and used verbatim. If field_name is a Symbol, it is
treated as a Ruby-style (underscored) name and camelized before comparing.
If arguments: is provided, each provided key/value will be matched
against the arguments in the next selection. This method will return false
if any of the given arguments: are not present and matching in the next selection.
(But, the next selection may contain more than the given arguments.)
86 87 88 |
# File 'lib/graphql/execution/lookahead.rb', line 86 def selects?(field_name, selected_type: @selected_type, arguments: nil) selection(field_name, selected_type: selected_type, arguments: arguments).selected? end |