Skip to content

Conversation

@coffeexcoin
Copy link

Adds a new parameter to ApiConfig to allows overriding the default fetch implementation with a custom one. This is useful if the consumer wants to mock fetch for tests or alternatively for creating a decorator to the default node fetch implementation for things like logging, metrics, etc.

Copy link

@bradens bradens left a comment

Choose a reason for hiding this comment

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

🎉

"X-Apollo-Operation-Name": "query",
...config.headers,
}),
fetch: config.fetch,
Copy link

Choose a reason for hiding this comment

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

I assume if config.fetch is undefined then it'll revert to it's original behaviour properly?

Copy link
Author

Choose a reason for hiding this comment

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

correct - the underlying graphql-request library provides a default implementation if the configured value is undefined.

@CaityGossland CaityGossland merged commit 7e54293 into Codex-Data:main Aug 15, 2025
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