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

Return GraphQLError instead of objects #1765

Merged
merged 9 commits into from
Feb 20, 2024
Merged

Conversation

michenly
Copy link
Contributor

@michenly michenly commented Feb 15, 2024

WHY are these changes introduced?

Apply better error logging from storefront API to Customer Account API

@michenly michenly self-assigned this Feb 15, 2024
@github-actions github-actions bot had a problem deploying to preview February 15, 2024 21:14 Failure
@@ -43,7 +43,6 @@ import {
minifyQuery,
assertQuery,
assertMutation,
extractQueryName,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not use

@michenly michenly changed the title Return GraphQLError instead of objects Feb 16, 2024
@michenly michenly marked this pull request as ready for review February 16, 2024 17:25
@michenly michenly changed the title [DO NOT MERGE] Return GraphQLError instead of objects Feb 16, 2024
Copy link
Contributor

@frandiox frandiox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Curious, why would you consider this a breaking change? The fact we are logging errors shouldn't break anything, no? Just more useful "noise" in the terminal.

We are changing the returned stuff to be a class instance instead of an object but I think that would only break if you do weird stuff with it 🤔

packages/hydrogen/src/customer/customer.ts Outdated Show resolved Hide resolved
packages/hydrogen/src/customer/types.ts Outdated Show resolved Hide resolved
packages/hydrogen/src/customer/types.ts Outdated Show resolved Hide resolved
packages/hydrogen/src/customer/customer.ts Outdated Show resolved Hide resolved
michenly and others added 4 commits February 20, 2024 09:52
Co-authored-by: Fran Dios <frankdiox@gmail.com>
Co-authored-by: Fran Dios <frankdiox@gmail.com>
Co-authored-by: Fran Dios <frankdiox@gmail.com>
Co-authored-by: Fran Dios <frankdiox@gmail.com>
@michenly
Copy link
Contributor Author

michenly commented Feb 20, 2024

hi @frandiox I made it a breaking change because we are manipulating the message being return in the error.
It can break if the merchant is doing string comparison for the error to determine how to act on it. (which is something I did for not login error before introducing our own utility)

However, upon reflection, since it is sorta a grey area on if the string manipulation would constitute a breaking change. But our next release is not till April. I do think merging this and see if any weird breakage occur is the pragmatic call for now.

@michenly michenly changed the title [Breaking Change for 2024-04] Return GraphQLError instead of objects Feb 20, 2024
@michenly michenly merged commit 06d9fd9 into main Feb 20, 2024
10 checks passed
@michenly michenly deleted the mc-add-graphql-error-ca-api branch February 20, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants