Replies: 1 comment 1 reply
-
You are not wrong, docs are incorrect here, because extension class is instantiated per query to let it store state. We should introduce utility functions for those like we do for query cost validator, that reduce partials keeping configuration from dev |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A bit confused on how an Ariadne extension is supposed to receive arguments upon instantiation.
There's an example of it in #608 with the
trace_default_resolver
argument, shown in the docs as being called like:When I try this however, I'm getting an error:
Indeed, this error makes sense — although the
ExtensionManager
purports to take anExtensionList
(which can be an instance of anExtension
as well as a class), it then immediately tries to call each extension. It also does not seem thatExtension
instances are expected to be callable.It seems like I'm missing something, rather than this being a bug; especially as the code that calls extensions predates the implementation of that extension with an argument. So how is this supposed to work?
Beta Was this translation helpful? Give feedback.
All reactions