Skip to content
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

Merged
merged 3 commits into from
Jun 15, 2020

Conversation

sachindshinde
Copy link
Contributor

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.

@@ -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) {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@sachindshinde sachindshinde force-pushed the sachin/throw-in-schema-reporting-if-federated branch 3 times, most recently from 85274ca to f5a36fe Compare June 15, 2020 19:28
Copy link
Contributor

@jsegaran jsegaran left a 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.

@sachindshinde sachindshinde force-pushed the sachin/throw-in-schema-reporting-if-federated branch from f5a36fe to 82c36ca Compare June 15, 2020 20:11
@sachindshinde sachindshinde merged commit b6ed57c into master Jun 15, 2020
@abernix abernix deleted the sachin/throw-in-schema-reporting-if-federated branch June 16, 2020 08:53
@abernix abernix added this to the Release 2.15.0 milestone Jun 16, 2020
trevor-scheer added a commit that referenced this pull request Jun 16, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants