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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context for GraphQL and REST clients #50

Merged
merged 2 commits into from Jun 21, 2022
Merged

Conversation

mszostok
Copy link
Contributor

@mszostok mszostok commented Jun 15, 2022

Description

Changes proposed in this pull request:

  • Add context.Context for GraphQL client. For all methods there is alternative, with pattern {method_name}WithContext
    • Add unit test for context.Canceled and context.DeadlineExceeded to prevent any regression.
  • Add context.Context for REST client. I added only DoWithContext and RequestWithContext. Rest methods are just a syntax sugar, and I don't see value into adding an alternative method to all of them. However, it's easy to add, so if you want to, let me know and I will do it 馃憤
    • Add unit test for context.Canceled and context.DeadlineExceeded to prevent any regression.

Related issue(s)

Fixes #47

Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

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

@mszostok This looks great, thanks for including tests with the PR!

@samcoe samcoe merged commit 3caf6c4 into cli:trunk Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add context to possibly long-running methods (external API)
2 participants