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 an empty array to the deprecated checkout endpoint #668

Merged
merged 8 commits into from
Sep 4, 2024

Conversation

vsseixaso
Copy link
Contributor

@vsseixaso vsseixaso commented Sep 3, 2024

What problem is this solving?

Checkout is deprecating the orders endpoint. To avoid throwing an error for store-graphql users, this PR catches the HTTP 405 error code thrown by Checkout and returns an empty array in the query.

How to test it?

  1. Access the GraphQL IDE in the Admin (workspace)
  2. Choose the app [email protected]*
  3. Run the following query:
    query {
        orders {
            allowCancellation
            orderId
            orderGroup
            state
            status
            statusDescription
            value
            salesChannel
            creationDate
            lastChange
            timeZoneCreationDate
            timeZoneLastChange
            invoicedDate
            isCompleted
        } 
    }
  4. The result should be as follows:
    {
        "data": {
            "orders": []
        }
    }

Screenshots or example usage:

[Before]
Screenshot 2024-09-03 at 11 40 14 AM

[After]
Screenshot 2024-09-03 at 12 01 33 PM

Related to / Depends on

PR do Checkout

How does this PR make you feel? 🔗

@vsseixaso vsseixaso self-assigned this Sep 3, 2024
@vsseixaso vsseixaso requested a review from a team as a code owner September 3, 2024 13:02
@vsseixaso vsseixaso requested review from hellofanny, lucasfp13 and RodrigoTadeuF and removed request for a team September 3, 2024 13:02
Copy link
Contributor

vtex-io-ci-cd bot commented Sep 3, 2024

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vsseixaso vsseixaso changed the title Draft: Return an empty array to the deprecated checkout endpoint Return an empty array to the deprecated checkout endpoint Sep 3, 2024
@vsseixaso vsseixaso removed the request for review from lariciamota September 3, 2024 15:29
@vsseixaso vsseixaso removed the request for review from RodrigoTadeuF September 3, 2024 15:29
manifest.json Outdated Show resolved Hide resolved
CHANGELOG.md Outdated


[Unreleased]: https://github.com/vtex-apps/store-graphql/compare/v2.171.1-beta...HEAD
[2.171.1-beta]: https://github.com/vtex-apps/store-graphql/compare/v2.171.0...v2.171.1-beta
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, we don't need to add beta and unreleased tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good, removed.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@iago1501 iago1501 left a comment

Choose a reason for hiding this comment

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

LGTM

@vsseixaso vsseixaso merged commit e97715f into master Sep 4, 2024
5 checks passed
@vsseixaso vsseixaso deleted the feat/resolve-deprecated-endpoint branch September 4, 2024 18:00
Copy link
Contributor

vtex-io-ci-cd bot commented Sep 4, 2024

Your PR has been merged! App is being published. 🚀
Version 2.171.1 → 2.171.2

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy [email protected]

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants