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
- Write a plugin adding a custom query.
- Misspell
graphQLasgraphQlwithin the plugin. - Plugin is registered, but your query is missing without any feedback.
Possible Solution
- Validate plugin object
- More robust logging (warning?) inside of
registerPluginWith either of the above,registerPlugincould throw an error on a misconfigured plugin.
Versions
3.10.0
Source: reactioncommerce/reaction