---
lang: en
title: 'API docs: graphql.registerresolver'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/graphql
permalink: /doc/en/lb4/apidocs.graphql.registerresolver.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/graphql](./graphql.md) &gt; [registerResolver](./graphql.registerresolver.md)

## registerResolver() function

Register a GraphQL resolver class

**Signature:**

```typescript
export declare function registerResolver(ctx: Context, resolverClass: Constructor<object>, nameOrOptions?: string | BindingFromClassOptions): Binding;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  ctx | [Context](./context.context.md) | Context object |
|  resolverClass | [Constructor](./context.constructor.md)<!-- -->&lt;object&gt; | Resolver class |
|  nameOrOptions | string \| [BindingFromClassOptions](./context.bindingfromclassoptions.md) | _(Optional)_ Resolver name or binding options |

**Returns:**

[Binding](./context.binding.md)


