Table of Contents

Interface IAnalyticsApi

Namespace
Cloudflare.NET.Analytics
Assembly
Cloudflare.NET.Analytics.dll

Defines the contract for a generic client to the Cloudflare Analytics GraphQL API.

public interface IAnalyticsApi

Methods

SendQueryAsync<TResponse>(GraphQLRequest, CancellationToken)

Sends a GraphQL query to the Cloudflare API.

Task<TResponse> SendQueryAsync<TResponse>(GraphQLRequest request, CancellationToken cancellationToken = default)

Parameters

request GraphQLRequest

The GraphQL request object, containing the query and variables.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<TResponse>

A task that represents the asynchronous operation. The task result contains the deserialized data from the API response's "data" field.

Type Parameters

TResponse

The type to deserialize the GraphQL response data into.

Exceptions

InvalidOperationException

Thrown if the GraphQL API returns errors or if the response data is null.