#6484·reaction

Validate Plugin Object/Function

Author: KaschmanCreated Dec 15, 2020Updated Oct 24, 2025
Labelsenhancement

Not so much a bug, but could be a Developer Experience improvement to have some kind of validation around plugins. For example, I was using graphQl instead of graphQL in a recent plugin; it took some time to track the issue down. Suggest either adding warning logging to the registerPlugins method or validating the plugin contents, perhaps with simpleSchema?

Not sure which approach is preferred, but happy to take a run at it when I get some time. If you have a preferred approach, let me know.

Prerequisites

  • [ x ] Are you running the latest version?
  • [ x ] Are you able to consistently reproduce the issue?
  • [ x ] Did you search the issue queue for existing issue? Search issues

Issue Description

Debugging plugin issues can be difficult; plugin validation or more robust logging inside registerPlugin could result in a better developer experience.

Steps to Reproduce

  1. Write a plugin adding a custom query.
  2. Misspell graphQL as graphQl within the plugin.
  3. Plugin is registered, but your query is missing without any feedback.

Possible Solution

  1. Validate plugin object
  2. More robust logging (warning?) inside of registerPlugin With either of the above, registerPlugin could throw an error on a misconfigured plugin.

Versions

3.10.0

Source: reactioncommerce/reaction