-
Notifications
You must be signed in to change notification settings - Fork 2k
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
apollo-server-core: Add option to specify fetcher for schema reporting #5179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable.
I don't think it needs to be experimental. fetcher
would follow the pattern we use in two places in federation (I think the only other pattern we have in this repo for it involves RESTDataSource which takes it as an unnamed argument).
Would you like to apply the same change the usage reporting plugin? Not sure why people would only want to override the client for one.
@@ -2,6 +2,7 @@ import os from 'os'; | |||
import type { InternalApolloServerPlugin } from '../internalPlugin'; | |||
import { v4 as uuidv4 } from 'uuid'; | |||
import { printSchema, validateSchema, buildSchema } from 'graphql'; | |||
import { fetch } from 'apollo-server-env'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be import type
? (We didn't use import type
in the past because we wanted to support older TS but have started using it recently.)
ab8bd85
to
baa4b55
Compare
@glasser |
We've gotten feedback that it would be nice for customers to have the ability to override the HTTP client for schema reporting. This PR adds that ability under a new
experimental_fetcher
option inApolloServerPluginSchemaReporting
(the syntax is similar toGatewayConfigBase.fetcher
). Since there's not significant logic changes involved, we may also want to just forgo marking it experimental, although I'll leave that decision to the reviewer.