Unify all link types - #12823
Conversation
…s is an internal implementation detail.
This reverts commit b92973c.
commit: |
size-limit report 📦
|
🦋 Changeset detectedLatest commit: b5c3403 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| export interface RetryFunctionOptions extends CallbackOptions {} | ||
| export interface DisableFunctionOptions extends CallbackOptions {} | ||
| export interface DisableFunctionOptions | ||
| extends PersistedQueryLink.RetryFunctionOptions {} |
There was a problem hiding this comment.
This felt more appropriate because disable is called with the retry options object.
|
| (count: number, operation: ApolloLink.Operation, error: any): number; | ||
| } | ||
|
|
||
| export interface DelayFunctionOptions { |
There was a problem hiding this comment.
I renamed this type from DelayFunctionOptions to DelayOptions in the namespaced type since this isn't actually used as part of a function call. These are used as:
new RetryLink({
delay: {
initial: ...,
max: ...,
jitter: ...
}
})So the "Function" part of the name seemed confusing.
| ): boolean | Promise<boolean>; | ||
| } | ||
|
|
||
| export interface RetryFunctionOptions { |
There was a problem hiding this comment.
Same here. Removed the "Function" part of RetryFunctionOptions for clarity.
| * Configuration for the retry strategy to use, or a custom retry strategy. | ||
| */ | ||
| attempts?: RetryFunctionOptions | RetryFunction; | ||
| attempts?: RetryLink.AttemptsOptions | RetryLink.AttemptsFunction; |
There was a problem hiding this comment.
Since the option here is called attempts, I renamed the function type to AttemptsFunction and the options object to AttemptsOptions to avoid confusion.
| export interface ErrorHandler { | ||
| // (undocumented) | ||
| (options: ErrorHandlerOptions): Observable<ApolloLink.Result> | void; | ||
| } | ||
|
|
There was a problem hiding this comment.
The call here is generally to drop all the old Types?
I'm for it, just gotta be really thorough with the codemod.
There was a problem hiding this comment.
I thought so since we've done it with others
Ensures link types are all namespaced. Discovered while working on #12822