private async Task <GraphQLDataResult <T> > GetDataResult(CancellationToken cancellationToken) { // Generate query var query = _queryGenerator.GenerateQuery(OperationType, SelectionSet, _filter, _arguments); // Get result var result = await _executor.ExecuteQuery( query : query, url : _url, method : _httpMethod, authorizationToken : _authorizationToken, authorizationMethod : _authorizationMethod, cancellationToken : cancellationToken, headers : _headers).ConfigureAwait(false); // Deserilize var deserilizationResult = _deserilization.DeserializeResult <T>(result.Response, SelectionSet); if (deserilizationResult?.Errors?.Any() ?? false) { throw new GraphQLErrorException(query: query, errors: deserilizationResult.Errors); } // Set headers deserilizationResult.Headers = result.Headers; return(deserilizationResult); }
/// <inheritdoc /> public async Task <dynamic> Execute() { var result = await _executor.ExecuteQuery <dynamic>(_query, _url, _httpMethod, _authorizationToken, _authorizationMethod).ConfigureAwait(false); if (result?.Errors?.Any() ?? false) { throw new GraphQLErrorException(query: _query, errors: result.Errors); } return(result?.Data); }