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

modify Context::upsert() #1073

Merged
merged 5 commits into from
May 18, 2022
Merged

modify Context::upsert() #1073

merged 5 commits into from
May 18, 2022

Conversation

garypen
Copy link
Contributor

@garypen garypen commented May 17, 2022

Remove the default parameter and require upserted values to implement
Default.

fixes: #1070

Remove the `default` parameter and require upserted values to implement
Default.
@garypen garypen requested review from BrynCooke and o0Ignition0o May 17, 2022 13:07
@garypen garypen self-assigned this May 17, 2022
@garypen garypen requested a review from StephenBarlow as a code owner May 17, 2022 13:07
@netlify
Copy link

netlify bot commented May 17, 2022

Deploy Preview for apollo-router-docs ready!

Name Link
🔨 Latest commit 89fac01
🔍 Latest deploy log https://app.netlify.com/sites/apollo-router-docs/deploys/6284bd1716164a00083a2dcb
😎 Deploy Preview https://deploy-preview-1073--apollo-router-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions

This comment has been minimized.

@o0Ignition0o
Copy link
Contributor

o0Ignition0o commented May 18, 2022

This looks great!

I m not sure I'd like to get rid of the ability to perform an upsert with a callback to set the value if there want any, are there drawbacks to keeping the former method and maybe renaming it?

EDIT: nevermind, we re calling the update callback regardless, so it s totally fine

@garypen
Copy link
Contributor Author

garypen commented May 18, 2022

This looks great!

I m not sure I'd like to get rid of the ability to perform an upsert with a callback to set the value if there want any, are there drawbacks to keeping the former method and maybe renaming it?

No one could think of a good reason to provide that ability, so my proposal is that we could always add a upsert_with_default() function (which would be the existing function added back) if we needed it, but no point adding it until we need it.

@garypen garypen merged commit fc7a96e into main May 18, 2022
@garypen garypen deleted the garypen/context-iface-change branch May 18, 2022 10:18
@BrynCooke BrynCooke added this to the v0.9.2 milestone May 20, 2022
@BrynCooke BrynCooke mentioned this pull request May 20, 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.

Change the Context::upsert() interface
3 participants