router icon indicating copy to clipboard operation
router copied to clipboard

Design a way for the router to know whether plugins are enabled or not

Open o0Ignition0o opened this issue 2 years ago • 2 comments

Maybe an is_enabled() method with a default set to true on the Plugin trait ?

o0Ignition0o avatar Sep 16 '22 08:09 o0Ignition0o

apollo-router/src/router_factory.rs uses configuration.plugins().into_iter() together with mandatory_plugins to decide what plugins to create instances of. So disabled plugins are not created at all, and Plugin::is_enabled doesn’t make sense if that’s the meaning we want for “enabled”.

What’s misleading in https://github.com/apollographql/router/issues/1802#issuecomment-1249067012 is that include_subgraph_errors is enabled by default, through mandatory_plugins, but with a config that makes it do nothing.

Why is this plugin “mandatory” in the first place? Should it not be?

SimonSapin avatar Sep 19 '22 11:09 SimonSapin

Hmm interesting, maybe we should just not add it indeed!

o0Ignition0o avatar Sep 19 '22 13:09 o0Ignition0o

I don't know that we have a user story that necessitates this at the moment, so we'll go ahead and close this until we have another story to tell. (We might, like for telemetry/usage data!)

abernix avatar Nov 18 '22 12:11 abernix