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

[Bugfix] Refactor Metrics #1280

Merged
merged 13 commits into from Oct 27, 2022
Merged

[Bugfix] Refactor Metrics #1280

merged 13 commits into from Oct 27, 2022

Conversation

antholeole
Copy link
Contributor

@antholeole antholeole commented Oct 19, 2022

Pull request checklist

  • Please read our contributor guide
  • Consider creating a discussion on the discussion forum
    first
  • Make sure the PR doesn't introduce backward compatibility issues
  • Make sure to have sufficient test cases

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Changes in this PR

  • Added DgsExecutionResult. This makes it easy for developers to change the http status code, as well as add headers to the response should they wish do that (see the example)
  • As per this, an empty query now returns a 400 response with the Apollo specification empty query message.
  • Fixed a bug where extensions was being left on the response (bug: "extensions" exposed in valid graphQL request  #1278)
  • Bunch of tests for everything above

This now does not break adding headers through the extension method due to this change. Let me know if this is necessary or not, considering it was added less than a week ago and probably does not have wide adoption yet (not sure about internally).

In general, again, I'd recommend reviewing commit by commit - the initial commit (b352287) was updated by @/berngp so I'm assuming it passed review - all the other commits are my changes and are hopefully descriptive .

lmk thoughts.

* Removed explicit empty query check so instrumentation can catch InvalidSyntax
* Mapped ValidationError and SyntaxError to BAD_REQUEST for micrometer
* Re-introduced micrometer to the example project
@antholeole antholeole closed this Oct 19, 2022
@antholeole antholeole reopened this Oct 19, 2022
@antholeole antholeole force-pushed the #1058-2 branch 5 times, most recently from a4ea394 to 6666853 Compare October 19, 2022 21:50
@antholeole antholeole marked this pull request as ready for review October 19, 2022 22:10
@antholeole antholeole changed the title [WIP][Bugfix] Refactor Metrics [Bugfix] Refactor Metrics Oct 20, 2022
@berngp
Copy link
Contributor

berngp commented Oct 26, 2022

@antholeole looks good to me, could you squash changes and rebase from master. Thanks for the PR and thanks again for introducing the DgsExecutionResult.

@antholeole
Copy link
Contributor Author

@berngp rebased, instead of squashing my branch can you click "Squash and merge" when merging?

@berngp berngp merged commit 79fd32e into Netflix:master Oct 27, 2022
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.

None yet

2 participants