# Dependency variable · @imqueue/graphql-dependency

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

The dependency description for a GraphQL object type — an alias for [GraphQLDependency.create()](https://imqueue.org/api/graphql-dependency/latest/graphql-dependency.graphqldependency.create/), and the intended way to reach every method on this package's API.

**Signature:**

```typescript
Dependency: typeof GraphQLDependency.create
```

## Remarks

Reads as a static constructor at the call site, but it is a lookup: the description is created on first use and the same one is returned afterwards. That is what allows `Dependency(SomeType)` to appear in as many modules as is convenient — a loader beside the type, requirements beside the relation, a `load()` in the resolver — and still describe one type once.

## Example


```typescript
Dependency(UserType).require(CompanyType, () => ({
    as: UserType.getFields().company,
    filter: {
        // the key belongs to CompanyType's loader filter, the value is the
        // field on UserType whose values fill it
        [CompanyType.getFields().id.name]:
            UserType.getFields().companyId,
    },
}));
```

