Class GraphQlLayoutServiceHandler

Version: 21.x

Supports making requests to the Sitecore layout service.

Inheritance
System.Object
GraphQlLayoutServiceHandler
Implements
System.IDisposable
Namespace: Sitecore.LayoutService.Client.RequestHandlers.GraphQL
Assembly: Sitecore.LayoutService.Client.dll
Syntax
RequestResponse
public class GraphQlLayoutServiceHandler : Object, ILayoutRequestHandler

Constructors

GraphQlLayoutServiceHandler(IGraphQLClient, ISitecoreLayoutSerializer, ILogger<GraphQlLayoutServiceHandler>)

Initializes a new instance of the GraphQlLayoutServiceHandler class.

Declaration
RequestResponse
public GraphQlLayoutServiceHandler(IGraphQLClient client, ISitecoreLayoutSerializer serializer, ILogger<GraphQlLayoutServiceHandler> logger)
Parameters
TypeNameDescription
GraphQL.Client.Abstractions.IGraphQLClientclient

The graphQl client to handle response data.

ISitecoreLayoutSerializerserializer

The serializer to handle response data.

Microsoft.Extensions.Logging.ILogger<GraphQlLayoutServiceHandler>logger

The Microsoft.Extensions.Logging.ILogger to use for logging.

Methods

Dispose()

Dispose GraphQLClient.

Declaration
RequestResponse
public void Dispose()

Request(SitecoreLayoutRequest, String)

Handles a request to the Sitecore layout service using the specified handler.

Declaration
RequestResponse
public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request, string handlerName)
Parameters
TypeNameDescription
SitecoreLayoutRequestrequest

The request details.

System.StringhandlerName

The name of the request handler to use to handle the request.

Returns
TypeDescription
System.Threading.Tasks.Task<SitecoreLayoutResponse>

The response of the request.

Implements

System.IDisposable

Do you have some feedback for us?

If you have suggestions for improving this article,