Skip to content

Commit

Permalink
fix: fixed plugins that were sent in a snap request
Browse files Browse the repository at this point in the history
  • Loading branch information
osher-sade committed Mar 31, 2020
1 parent 98a8bdf commit 2aa5b82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/plugins/snapshot/snapshot-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ export class SnapshotListener implements GraphQLRequestListener<PolarisGraphQLCo
this.logger = logger;
this.snapshotConfiguration = snapshotConfiguration;

const pluginsWithoutSnapshot = remove(
polarisServer.getPlugins(),
(plugin: ApolloServerPlugin) => plugin instanceof SnapshotPlugin,
);
const plugins = polarisServer.getPlugins();
remove(plugins, (plugin: ApolloServerPlugin) => plugin instanceof SnapshotPlugin);

this.httpQueryOptions = {
...polarisServer.apolloServer.requestOptions,
plugins: pluginsWithoutSnapshot,
plugins,
schema: graphQLSchema,
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/polaris-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ export class PolarisServer {
const requestId = headers[REQUEST_ID] || uuid();
const upn = headers[OICD_CLAIM_UPN];
const realityId = +headers[REALITY_ID] || 0;
const snapRequest = headers[SNAP_REQUEST] || false;
const snapPageSize = +headers[SNAP_PAGE_SIZE] || 0;
const snapRequest = headers[SNAP_REQUEST] === 'true';
const snapPageSize = +headers[SNAP_PAGE_SIZE];

const supportedRealities = this.getSupportedRealities();
const reality: Reality | undefined = supportedRealities.getReality(realityId);
Expand Down

0 comments on commit 2aa5b82

Please sign in to comment.