Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate Plugin Object/Function #6484

Open
Kaschman opened this issue Dec 15, 2020 · 0 comments
Open

Validate Plugin Object/Function #6484

Kaschman opened this issue Dec 15, 2020 · 0 comments
Labels
enhancement For issues that describe a feature that needs to be added, changed, or removed, but is not a bug

Comments

@Kaschman
Copy link

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

@Kaschman Kaschman added the bug For issues that describe a defect or regression in the released software label Dec 15, 2020
@zenweasel zenweasel added enhancement For issues that describe a feature that needs to be added, changed, or removed, but is not a bug and removed bug For issues that describe a defect or regression in the released software labels Jul 4, 2022
@zenweasel zenweasel transferred this issue from reactioncommerce/api-core Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For issues that describe a feature that needs to be added, changed, or removed, but is not a bug
Projects
Current Work
  
Plan
Development

No branches or pull requests

2 participants