Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Include query body in API deprecation logs #426

Merged
merged 1 commit into from
Jul 20, 2022
Merged

Conversation

paulomarg
Copy link
Contributor

@paulomarg paulomarg commented Jul 20, 2022

WHY are these changes introduced?

Related to Shopify/cli#156

Currently, we're logging deprecation notices, but for the GraphQL API, we don't get a lot of details - since every request lands in the same endpoint, there's no way to tell them apart.

WHAT is this pull request doing?

Adding the first 100 characters from the body (if one exists) to help indicate which query is triggering the logs, to make it easier for developers to figure out where they're hitting deprecated fields.

API Deprecation Notice: {
  message: 'https://shopify.dev/api/usage/versioning#deprecation-practices',
  path: 'https://shop.myshopify.com/admin/api/2022-07/graphql.json',
  body: 'query products {\\n        products(first: 2) {\\n          nodes {\\n            title\\n            bodyHt...'
}

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
  • I have added/updated tests for this change

@paulomarg paulomarg requested a review from a team as a code owner July 20, 2022 19:27
@paulomarg paulomarg force-pushed the improve_deprecation_logs branch from b5fc785 to 251bb0d Compare July 20, 2022 19:28
@paulomarg paulomarg force-pushed the improve_deprecation_logs branch from 251bb0d to 223d546 Compare July 20, 2022 19:58
@paulomarg paulomarg merged commit 4481a31 into main Jul 20, 2022
@paulomarg paulomarg deleted the improve_deprecation_logs branch July 20, 2022 20:08
@shopify-shipit shopify-shipit bot temporarily deployed to production July 20, 2022 21:00 Inactive
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants