# Dependency variable · @imqueue/type-graphql-dependency

Source: https://imqueue.org/api/type-graphql-dependency/latest/type-graphql-dependency.dependency/
Published: 2026-07-31
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/type-graphql-dependency 3.0.3 — generated reference, not hand-written

The dependency description for a `type-graphql` class — the runtime half of this package, for loading dependencies inside a resolver.

**Signature:**

```typescript
Dependency: DependencyInterface<any>
```

## Remarks

This looks up a description; it does not define one. Use [DependencyFor()](https://imqueue.org/api/type-graphql-dependency/latest/type-graphql-dependency.dependencyfor/) to declare loaders, requirements and initializers, and this to reach the `load()` that resolves them.

It works by mapping the class to the GraphQL type of the same name in [DependencyInterface.schema](https://imqueue.org/api/type-graphql-dependency/latest/type-graphql-dependency.dependencyinterface.schema/) and delegating to `Dependency` from `@imqueue/graphql-dependency`. So the class name and the GraphQL type name have to agree: giving `@ObjectType` an explicit `name` option that differs from the class name breaks the lookup.

## Example


```typescript
import { Dependency } from '@imqueue/type-graphql-dependency';

// in a resolver, before returning the data
await Dependency(Consumer).load(data, context, fields);
```

