Skip to content

Conversation

AnthonyMDev
Copy link
Contributor

This PR adds extensive inline documentation to the RequestChain, JSONResponse Parser, and all Interceptor related public types.

The inline documentation includes detailed descriptions of how interceptors should be implemented and how data flows through the RequestChain.

A future PR will add usage guides to the docs website with more step-by-step instructions on creating a custom RequestChain and examples of a number of possible interceptor implementations.

@apollo-librarian
Copy link

apollo-librarian bot commented Sep 12, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 16ae1d3eb9d65b561ca95e23
Build Logs: View logs

Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

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

Looks really good, minor comments all round.

/// Manages a chain of steps taken to execute a ``GraphQLRequest``. ``RequestChain`` enables customization of each step
/// of a request by injection of ``Interceptors``.
///
/// ## Configuration via Interceptors
Copy link
Member

Choose a reason for hiding this comment

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

I'm unsure whether "configuration" is the correct description here. Feels more like "functionality" vs. a configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing this and the lines below it. Let me know if that feels better.

Copy link
Member

Choose a reason for hiding this comment

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

I like it. Good change.

Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

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

Last comments otherwise LGTM!

public struct RequestChain<Request: GraphQLRequest>: Sendable {

/// An error that can be thrown by component of a ``RequestChain`` to indicate that the request should be retried.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// An error that can be thrown by component of a ``RequestChain`` to indicate that the request should be retried.
/// An error that can be thrown by a component of a ``RequestChain`` to indicate that the request should be retried.

/// as the initial request. This means that interceptors will retain their state between retries of the same request.
///
/// ## Retry Loop Prevention
/// If an interceptor throws a ``Retry`` error again on the retried request, it will continue retry the request again.
Copy link
Member

Choose a reason for hiding this comment

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

it will continue retry the request again

I'm not sure how the sentence should read here; "continually retry"?

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.

3 participants