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

Breaking: Revert "Breaking: Fix plugin addition" #1838

Merged

Conversation

Code-Hex
Copy link
Contributor

@Code-Hex Code-Hex commented Jan 24, 2022

Reverts #1717

  • Some plugins that worked in versions prior to v0.15, which generated code based on a previously generated model, no longer work above v0.15.
    • gqlgen/api/generate.go

      Lines 21 to 32 in 8b25c9e

      plugins := []plugin.Plugin{}
      if cfg.Model.IsDefined() {
      plugins = append(plugins, modelgen.New())
      }
      plugins = append(plugins, resolvergen.New())
      if cfg.Federation.IsDefined() {
      plugins = append([]plugin.Plugin{federation.New()}, plugins...)
      }
      for _, o := range option {
      o(cfg, &plugins)
      }
  • I think we shouldn't implicit breaking changes should be made
  • If we want to achieve the behavior he claims, we should create a new API.
    • e.g. func PrependPlugin

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 74.923% when pulling a0fada2 on Code-Hex:revert-1717-add-plugin-fix into fcee4c4 on 99designs:master.

Code-Hex added a commit to Code-Hex/gqlgen that referenced this pull request Jan 24, 2022
@Code-Hex Code-Hex mentioned this pull request Jan 24, 2022
2 tasks
@StevenACoffman StevenACoffman merged commit 972878a into 99designs:master Jan 24, 2022
StevenACoffman pushed a commit that referenced this pull request Jan 24, 2022
* add PrependPlugin

related: #1838

* added test for PrependPlugin
@StevenACoffman StevenACoffman changed the title Revert "Fix plugin addition" Breaking: Revert "Fix plugin addition" Jan 24, 2022
@StevenACoffman StevenACoffman changed the title Breaking: Revert "Fix plugin addition" Breaking: Revert "Breaking: Fix plugin addition" Jan 24, 2022
@Code-Hex Code-Hex deleted the revert-1717-add-plugin-fix branch January 24, 2022 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants