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 derived data is computed twice #5729

Closed
tovbinm opened this issue Sep 21, 2021 · 2 comments · Fixed by #5757
Closed

Schema derived data is computed twice #5729

tovbinm opened this issue Sep 21, 2021 · 2 comments · Fixed by #5757

Comments

@tovbinm
Copy link

tovbinm commented Sep 21, 2021

Hello,

When profiling our service application (below) I noticed that Apollo Server generates schema derived data twice. Since it's a time consuming operation I would assume it should only be happening once. For the context here is our server code snippet and profiler chart:

export async function createViewMiddleware(params: ViewMiddlewareParams): Promise<ApolloMiddleware> {
	  const server = new ApolloServer({
	      schema: params.graphqlSchema,
	      plugins: params.plugins,
	      introspection: true,
	      mocks: false,
	      mockEntireSchema: false,
	      persistedQueries: false,
	      stopOnTerminationSignals: true,
	  });
	  await server.start();
	  return { middleware: toKoaMiddleware(server), server };
}

Screen Shot 2021-09-20 at 10 23 56 PM

@glasser
Copy link
Member

glasser commented Sep 22, 2021

@sachindshinde Can you take a quick look at this? I think this might be expected due to the changes we made with SchemaManager and maybe it's avoidable? (Note that they are using {schema}, not gateway.

@sachindshinde
Copy link
Contributor

@glasser It turned out to be avoidable without too much issue, PR to fix at #5757 .

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants