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

feat(core): Allow partial context in makeOperation (QOL) #3081

Merged
merged 3 commits into from
Mar 20, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 19, 2023

Summary

This is a small quality of life improvement for the makeOperation helper in @urql/core that'll mainly benefit users rather than the core code.

When makeOperation is called with an Operation rather than a request, we should spread OperationContext and allow a partial one.

// before
makeOperation(operation.kind, operation, {
  ...operation.context,
  requestPolicy: 'cache-and-network',
});

// after
makeOperation(operation.kind, operation, {
  requestPolicy: 'cache-and-network',
});

## Set of changes

- Allow partial `OperationContext` for when `makeOperation` is called on an `Operation` rather than a `GraphQLRequest`

@kitten kitten merged commit e226c5b into main Mar 20, 2023
@kitten kitten deleted the feat/qol-makeoperation branch March 20, 2023 07:12
@github-actions github-actions bot mentioned this pull request Mar 20, 2023
@github-actions github-actions bot mentioned this pull request Mar 27, 2023
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.

2 participants