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

Fix get request with query #135

Merged
merged 10 commits into from
Mar 24, 2021
Merged

Conversation

derom
Copy link
Contributor

@derom derom commented Mar 13, 2021

WHY are these changes introduced?

Fixes #134

WHAT is this pull request doing?

Added test to catch the described error. Made limit optional, because it has default value (50)

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

@derom derom requested a review from a team as a code owner March 13, 2021 10:54
@ghost ghost added cla-needed and removed cla-needed labels Mar 13, 2021
thecodepixi
thecodepixi previously approved these changes Mar 15, 2021
Copy link
Contributor

@thecodepixi thecodepixi left a comment

Choose a reason for hiding this comment

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

This makes sense to me. We should definitely be able to make REST requests without passing a limit, since the API will just apply its default limit to the request. Thanks for catching that.

@derom derom force-pushed the fix-get-request-with-query branch from cc2173e to 8c4a0b4 Compare March 15, 2021 20:46
@derom
Copy link
Contributor Author

derom commented Mar 15, 2021

Thanks for review @thecodepixi
I've pushed some changes. limit in PageInfo is non-optional again. I realized that the limit is always known and we should just set the default value if a user didn't specify the limit. Also, unused type PageInfoParams was removed

@derom derom requested a review from thecodepixi March 15, 2021 21:31
@thecodepixi thecodepixi dismissed their stale review March 16, 2021 18:26

Too many additional changes. Will re-review.

@thecodepixi
Copy link
Contributor

Taking another look at this now, and I'm not sure we can entirely do away with `PageInfo, but have asked for additional opinions on that front.

@paulomarg
Copy link
Contributor

I agree, it's a bit strange that it doesn't cause any tests to break, but we're definitely still using that type in the REST client class.

@derom
Copy link
Contributor Author

derom commented Mar 19, 2021

@thecodepixi @paulomarg PageInfoParams was replaced by PageInfo in this commit 53b5e07
I didn't find any usages of that interface https://github.com/Shopify/shopify-node-api/search?q=PageInfoParams

@thecodepixi
Copy link
Contributor

Ah OK, maybe that was my misunderstanding. You're proposing just removing PageInfoParams but not PageInfo?

@derom
Copy link
Contributor Author

derom commented Mar 19, 2021

Yes, only PageInfoParams

@thecodepixi
Copy link
Contributor

Yes, only PageInfoParams

Oh then yeah, if that's no longer needed I would think it's fine to remove.

Copy link
Contributor

@thecodepixi thecodepixi left a comment

Choose a reason for hiding this comment

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

I think this looks pretty great at this point! Would love an additional review from @paulomarg but I give this a 👍

Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

I like it too! 🚀

@derom
Copy link
Contributor Author

derom commented Mar 24, 2021

Should I do anything else to merge this pr?

@thecodepixi
Copy link
Contributor

Should I do anything else to merge this pr?

I gotchu!

@thecodepixi thecodepixi merged commit 241e988 into Shopify:main Mar 24, 2021
@shopify-shipit shopify-shipit bot temporarily deployed to production March 26, 2021 18:46 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rest client. Get request with query fails if the limit is not specified
3 participants