GraphQL server response is very slow with a large number of types and interfaces

353 views Asked by At

Env Details :

"@neo4j/graphql": "^3.12.0",
"@neo4j/introspector": "^1.0.2",
"apollo-server": "^3.11.1",
"dotenv": "^16.0.3",
"graphql": "^16.6.0",
"neo4j-driver": "^4.4.3"
 OS : Windows10

We have 201 type definitions and 105 interface definitions in graphql file. neo4j graphql generates SDL file of size around 26 MB ( around 8002 type def in SDL )

Problem is , a simple query takes around 10-15 minutes to get the response and sometimes we don't even get the response. Below is code snippet to start server

const server = new ApolloServer({ 
  schema: schema, 
  introspection: true, 
  playground: true, 
});

However, if we work with a smaller number(~20-25) of type definitions then it works as expected.

Is there any size limit or restriction on the number of type definitions in graphql?

0

There are 0 answers