code: protected function queryAllOrOne($query, EncodingParametersInterface $parameters)
      {
          $filters = collect($parameters->getFilteringParameters());
  
          if ($this->isSearchOne($filters)) {
              return $this->queryOne($query, $parameters);
          }
  
          return $this->queryAll($query, $parameters);
      }
docs: Default query execution used when querying records or relations.
  
  @param $query
  @param EncodingParametersInterface $parameters
  @return mixed