(pluginId: string)
| 398 | } |
| 399 | |
| 400 | $unuse(pluginId: string) { |
| 401 | // tsc perf |
| 402 | const newPlugins: AnyPlugin[] = []; |
| 403 | for (const plugin of this.options.plugins ?? []) { |
| 404 | if (plugin.id !== pluginId) { |
| 405 | newPlugins.push(plugin); |
| 406 | } |
| 407 | } |
| 408 | const newOptions: ClientOptions<SchemaDef> = { |
| 409 | ...this.options, |
| 410 | plugins: newPlugins, |
| 411 | }; |
| 412 | const newClient = new ClientImpl(this.schema, newOptions, this); |
| 413 | // create a new validator to have a fresh schema cache, because plugins may |
| 414 | // extend the query args schemas |
| 415 | newClient.inputValidator = new InputValidator(newClient as any, { |
| 416 | enabled: newClient.$options.validateInput !== false, |
| 417 | }); |
| 418 | return newClient; |
| 419 | } |
| 420 | |
| 421 | $unuseAll() { |
| 422 | // tsc perf |
no test coverage detected