---
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

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

ctx


</td><td>

[Context](./context.context.md)


</td><td>

Context object


</td></tr>
<tr><td>

resolverClass


</td><td>

[Constructor](./context.constructor.md)<!-- -->&lt;object&gt;


</td><td>

Resolver class


</td></tr>
<tr><td>

nameOrOptions


</td><td>

string \| [BindingFromClassOptions](./context.bindingfromclassoptions.md)


</td><td>

_(Optional)_ Resolver name or binding options


</td></tr>
</tbody></table>

**Returns:**

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


