graphql icon indicating copy to clipboard operation
graphql copied to clipboard

{types,graphql_test}: Adds `Result.ErrorsJoined` implementation.

Open chris-ramon opened this issue 10 months ago • 1 comments

Details

  • Depends on: https://github.com/graphql-go/graphql/pull/718
  • types: adds Result.ErrorsJoined method.
  • graphql_test: adds Result.ErrorsJoined 100& test coverage unit tests.
  • .circleci/config.yml: upgrades circleci go versions.

Added in order to be able to join errors because currently Result.Errors returns an slice of errors and is common use case to have it consolidated into a single error.

This PR leverages the %w error formatting verb in order to wrap errors. Ref: https://go.dev/doc/go1.13#error_wrapping

Test Plan

:heavy_check_mark: Tested that Result.ErrorsJoined works as expected via go test -cover ...:

go clean -testcache && go test -cover -coverprofile=coverage.out ./... && go tool cover -html=coverage.out -o coverage.html; sed -i'' -e's/black/whitesmoke/g' coverage.html && open coverage.html

Screenshot from 2025-03-28 16-11-33

chris-ramon avatar Mar 28 '25 21:03 chris-ramon

I'm getting to work. See my steps and track my cost here.

  • [ ] Wake on any new activity. I always see new activity while actively working. When paused, I'll only respond when tagged unless this box is checked.

mentatbot[bot] avatar Mar 28 '25 21:03 mentatbot[bot]