lib/rails/graphql/request/component/field.rb
# Check if the field was assigned correctly to an output field
Check if the field was assigned correctly to an output field
Check if the field was assigned correctly to an output field
def check_assignment!
            raise MissingFieldError, <<~MSG.squish if field.nil?
              Unable to find a field named "#{gql_name}" on
              #{entry_point? ? operation.kind : parent.type_klass.name}.
            MSG
            raise FieldError, <<~MSG.squish unless field.output_type?
              The "#{gql_name}" was assigned to a non-output type of field: #{field.inspect}.
            MSG
            empty_selection = data[:selection].nil? || data[:selection].null?
            raise FieldError, <<~MSG.squish if field.leaf_type? && !empty_selection
              The "#{gql_name}" was assigned to the #{type_klass.gql_name} which
              is a leaf type and does not have nested fields.
            MSG
            raise FieldError, <<~MSG.squish if !field.leaf_type? && empty_selection
              The "#{gql_name}" was assigned to the #{type_klass.gql_name} which
              is not a leaf type and requires a selection of fields.
            MSG
            raise DisabledFieldError, <<~MSG.squish if field.disabled?
              The "#{gql_name}" was found but it is marked as disabled.
            MSG
          end
def check_assignment! raise MissingFieldError , <<~MSG . squish if field . nil? 
              Unable to find a field named " #{ gql_name } " on
               #{ entry_point? ? operation . kind : parent . type_klass . name } .
             MSG raise FieldError , <<~MSG . squish unless field . output_type? 
              The " #{ gql_name } " was assigned to a non-output type of field:  #{ field . inspect } .
             MSG empty_selection = data [ :selection ] . nil? || data [ :selection ] . null? raise FieldError , <<~MSG . squish if field . leaf_type? && ! empty_selection 
              The " #{ gql_name } " was assigned to the  #{ type_klass . gql_name }  which
              is a leaf type and does not have nested fields.
             MSG raise FieldError , <<~MSG . squish if ! field . leaf_type? && empty_selection 
              The " #{ gql_name } " was assigned to the  #{ type_klass . gql_name }  which
              is not a leaf type and requires a selection of fields.
             MSG raise DisabledFieldError , <<~MSG . squish if field . disabled? 
              The " #{ gql_name } " was found but it is marked as disabled.
             MSG end
Check if the field was assigned correctly to an output field
Check if the field was assigned correctly to an output field