-
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
schema-reporting: Throw if gateway or federated service #4246
schema-reporting: Throw if gateway or federated service #4246
Conversation
@@ -314,6 +314,16 @@ export class ApolloServerBase { | |||
// Don't add the extension here (we want to add it later in generateSchemaDerivedData). | |||
} | |||
|
|||
if (gateway && typeof engine === 'object' && engine.experimental_schemaReporting) { |
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 doesn't include the case where someone uses the environment variable. I think it would be less brittle if we make schemaReporting
boolean public on the agent, and then check if that is true.
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.
Good catch!
85274ca
to
f5a36fe
Compare
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.
We should add something to the changelog to state this will throw if used in a gateway or federated service, but looks good to me.
f5a36fe
to
82c36ca
Compare
This PR adds code to Apollo Server that throws if schema-reporting is enabled for the gateway or for a graph that looks like a federated service.