---
title: "Class GraphQlLayoutServiceHandler"
slug: "sitecore.layoutservice.client.requesthandlers.graphql.graphqllayoutservicehandler"
abstract: ""
---
# Class GraphQlLayoutServiceHandler

Supports making requests to the Sitecore layout service.

## Inheritance

System.Object

GraphQlLayoutServiceHandler

### Implements

[ILayoutRequestHandler](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.layoutservice.client.ilayoutrequesthandler.html)

System.IDisposable

#### **Namespace**: Sitecore.LayoutService.Client.RequestHandlers.GraphQL

##### **Assembly**: Sitecore.LayoutService.Client.dll

##### Syntax

```csharp
public class GraphQlLayoutServiceHandler : Object, ILayoutRequestHandler

```

### Constructors

#### GraphQlLayoutServiceHandler(IGraphQLClient, ISitecoreLayoutSerializer, ILogger<GraphQlLayoutServiceHandler>)

Initializes a new instance of the [GraphQlLayoutServiceHandler](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.layoutservice.client.requesthandlers.graphql.graphqllayoutservicehandler.html) class.

##### Declaration

```csharp
public GraphQlLayoutServiceHandler(IGraphQLClient client, ISitecoreLayoutSerializer serializer, ILogger<GraphQlLayoutServiceHandler> logger)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| GraphQL.Client.Abstractions.IGraphQLClient | client | The graphQl client to handle response data. |
| ISitecoreLayoutSerializer | serializer | The serializer to handle response data. |
| Microsoft.Extensions.Logging.ILogger<br><br><<br><br>GraphQlLayoutServiceHandler<br><br>> | logger | The Microsoft.Extensions.Logging.ILogger to use for logging. |

### Methods

#### Dispose()

Dispose GraphQLClient.

##### Declaration

```csharp
public void Dispose()

```

#### Request(SitecoreLayoutRequest, String)

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

##### Declaration

```csharp
public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request, string handlerName)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| SitecoreLayoutRequest | request | The request details. |
| System.String | handlerName | The name of the request handler to use to handle the request. |

##### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task<br><br><<br><br>SitecoreLayoutResponse<br><br>> | The response of the request. |

### Implements

[ILayoutRequestHandler](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.layoutservice.client.ilayoutrequesthandler.html)

System.IDisposable
