From e7a70af7a51a1637814940200f61dd35658e0fdb Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Tue, 6 Feb 2024 11:09:23 -0800 Subject: [PATCH] doc(Decorate): Explain that decorators can not add new values to the graph (#1151) I created #1144 because I was not sure whether a decorator could add new values to the graph. This clarifies the behavior. We already have tests to verify this behavior. Resolves #1144 --- decorate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decorate.go b/decorate.go index 509134517..691bd4751 100644 --- a/decorate.go +++ b/decorate.go @@ -123,6 +123,11 @@ import ( // return r // }), // +// Decorators can not add new values to the graph, +// only modify or replace existing ones. +// Types returned by a decorator that are not already in the graph +// will be ignored. +// // # Decorator scope // // Modifications made to the Fx graph with fx.Decorate are scoped to the