From e286f662657675fa790f33abcd6aa87b5aac2be3 Mon Sep 17 00:00:00 2001 From: Henri Normak Date: Fri, 10 Feb 2023 15:44:00 +0200 Subject: [PATCH] fix: expose `name` in Dataloader instance types (#334) * fix: expose name on Dataloader instance * docs: add changeset --- .changeset/rare-planes-stare.md | 5 +++++ src/index.d.ts | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/rare-planes-stare.md diff --git a/.changeset/rare-planes-stare.md b/.changeset/rare-planes-stare.md new file mode 100644 index 0000000..fc01c79 --- /dev/null +++ b/.changeset/rare-planes-stare.md @@ -0,0 +1,5 @@ +--- +'dataloader': patch +--- + +Added missing type definition for Dataloader.name diff --git a/src/index.d.ts b/src/index.d.ts index 9749228..136ad88 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -59,6 +59,14 @@ declare class DataLoader { * change is made. Returns itself for method chaining. */ prime(key: K, value: V | PromiseLike | Error): this; + + + /** + * The name given to this `DataLoader` instance. Useful for APM tools. + * + * Is `null` if not set in the constructor. + */ + name: string | null; } declare namespace DataLoader {