# onCreateSchema() function · @imqueue/type-graphql-dependency

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

Registers a hook to run when the schema is created, ignoring a handler already registered.

**Signature:**

```typescript
export declare function onCreateSchema(handler: CreateSchemaHook): void;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| handler | [CreateSchemaHook](https://imqueue.org/api/type-graphql-dependency/latest/type-graphql-dependency.createschemahook/) | the hook to run with the built schema |


**Returns:**

void

## Remarks

[DependencyFor()](https://imqueue.org/api/type-graphql-dependency/latest/type-graphql-dependency.dependencyfor/) uses this internally; call it directly to defer wiring of your own that also needs the finished schema. De-duplication is by function identity, so a named function passed twice is stored once while two identical inline arrows are two hooks.

