Skip to content

Commit e527472

Browse files
committed
Check the agent's schemaReport field instead of checking options
1 parent a9c4b3d commit e527472

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/apollo-engine-reporting/src/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ export class EngineReportingAgent<TContext = any> {
389389
};
390390

391391
private readonly tracesEndpointUrl: string;
392-
private readonly schemaReport: boolean;
392+
readonly schemaReport: boolean;
393393

394394
public constructor(options: EngineReportingOptions<TContext> = {}) {
395395
this.options = options;

packages/apollo-server-core/src/ApolloServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export class ApolloServerBase {
314314
// Don't add the extension here (we want to add it later in generateSchemaDerivedData).
315315
}
316316

317-
if (gateway && typeof engine === 'object' && engine.experimental_schemaReporting) {
317+
if (gateway && this.engineReportingAgent?.schemaReport) {
318318
throw new Error(
319319
[
320320
"Schema reporting is not yet compatible with the gateway. If you're",
@@ -781,7 +781,7 @@ export class ApolloServerBase {
781781
'to report metrics to Apollo Graph Manager.',
782782
);
783783

784-
if (typeof engine === 'object' && engine.experimental_schemaReporting) {
784+
if (this.engineReportingAgent.schemaReport) {
785785
throw Error(
786786
[
787787
"Schema reporting is not yet compatible with federated services.",

0 commit comments

Comments
 (0)