Class GraphQlLayoutServiceHandler

Version: 21.x

Supports making requests to the Sitecore layout service.

Inheritance

System.Object

GraphQlLayoutServiceHandler

Implements

ILayoutRequestHandler

System.IDisposable

Namespace: Sitecore.LayoutService.Client.RequestHandlers.GraphQL

Assembly: Sitecore.LayoutService.Client.dll
Syntax
public class GraphQlLayoutServiceHandler : Object, ILayoutRequestHandler

Constructors

GraphQlLayoutServiceHandler(IGraphQLClient, ISitecoreLayoutSerializer, ILogger)

Initializes a new instance of the GraphQlLayoutServiceHandler class.

Declaration
public GraphQlLayoutServiceHandler(IGraphQLClient client, ISitecoreLayoutSerializer serializer, ILogger<GraphQlLayoutServiceHandler> logger)
Parameters
TypeNameDescription
GraphQL.Client.Abstractions.IGraphQLClientclientThe graphQl client to handle response data.
ISitecoreLayoutSerializerserializerThe serializer to handle response data.
Microsoft.Extensions.Logging.ILogger

<

GraphQlLayoutServiceHandler

>
loggerThe Microsoft.Extensions.Logging.ILogger to use for logging.

Methods

Dispose()

Dispose GraphQLClient.

Declaration
public void Dispose()

Request(SitecoreLayoutRequest, String)

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

Declaration
public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request, string handlerName)
Parameters
TypeNameDescription
SitecoreLayoutRequestrequestThe request details.
System.StringhandlerNameThe name of the request handler to use to handle the request.
Returns
TypeDescription
System.Threading.Tasks.Task

<

SitecoreLayoutResponse

>
The response of the request.

Implements

ILayoutRequestHandler

System.IDisposable

If you have suggestions for improving this article, let us know!