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

Make all fields of *gqlerror.Error public #273

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

fredzqm
Copy link
Contributor

@fredzqm fredzqm commented Sep 7, 2023

I really like the validation.ErrorOption pattern. It makes it possible to build *gqlerror.Error with a chain of options.

rule.rule(observers, func(options ...ErrorOption) {
err := &gqlerror.Error{
Rule: rule.name,
}
for _, o := range options {
o(err)
}
errs = append(errs, err)
})

However, it cannot set err in the accumulating *gqlerror.Error. Why can't all fields of *gqlerror.Error be public?

I have:

  • Added tests covering the bug / feature
  • Updated any relevant documentation

@fredzqm fredzqm changed the title Make *gqlerror.Error err public Make all fields of *gqlerror.Error public Sep 7, 2023
@StevenACoffman
Copy link
Collaborator

Yeah, not sure why it wasn't public before. Thanks!

@StevenACoffman StevenACoffman merged commit c0a44fb into vektah:master Sep 7, 2023
2 checks passed
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.

2 participants