public function fetch($query, $params = null, $options = [])
    {
        $unfilteredResponse = isset($options['filterResponse']) && $options['filterResponse'] === false;

        $serializedParams = $params ? ParameterSerializer::serialize($params) : [];
        $queryParams = array_merge(['query' => $query], $serializedParams);

        $body = $this->request([
            'url' => '/data/query/' . $this->clientConfig['dataset'],
            'query' => $queryParams,
            'cdnAllowed' => true
        ]);

        return $unfilteredResponse ? $body :  $body['result'];
    }
public function fetch($query, $params = null, $options = [])
    {
        $unfilteredResponse = isset($options['filterResponse']) && $options['filterResponse'] === false;

        $serializedParams = $params ? ParameterSerializer::serialize($params) : [];
        $queryParams = array_merge(['query' => $query], $serializedParams);

        $body = $this->request([
            'url' => '/data/query/' . $this->clientConfig['dataset'],
            'query' => $queryParams,
            'cdnAllowed' => true
        ]);

        return $unfilteredResponse ? $body :  $body['result'];
    }
public function fetch ( $ query , $ params = null , $ options = [ ] ) { $ unfilteredResponse = isset ( $ options [ 'filterResponse' ] ) && $ options [ 'filterResponse' ] === false ; $ serializedParams = $ params ? ParameterSerializer :: serialize ( $ params ) : [ ] ; $ queryParams = array_merge ( [ 'query' => $ query ] , $ serializedParams ) ; $ body = $ this -> request ( [ 'url' => '/data/query/' . $ this -> clientConfig [ 'dataset' ] , 'query' => $ queryParams , 'cdnAllowed' => true ] ) ; return $ unfilteredResponse ? $ body : $ body [ 'result' ] ; }
Query for documents

Given a GROQ-query and an optional set of parameters, run a query against the API
and return the decoded result.

@param string $query GROQ-query to send to the API
@param array $params Associative array of parameters to use for the query
@param array $options Optional array of options for the query operation
@return mixed Returns the result - data type depends on the query
Query for documents