0

I build graphql server based on the node.js, objection.js, objection-graphql, knex. I have about 200 models in the app and it worked good before I connect relations. Each model has in avarage 3 relation model, exist many loops, by this cause I use next construction for connecting relation model:

modelClass: path.join(__dirname, "tableName").

At the moment the requests are happening either 10+ times slower or I get an error like this:

Failed to connect to nameserver.com:443 in 15000ms

I analyzed sql queries, that build knex it seems that the problem with performance not with sql.

How to solve this problem?

befreeforlife
  • 481
  • 2
  • 7
  • 21
  • Problem seems to be that your network is not finding the nameserver, thus cannot resolve IP and connect the DB. Nothing to do with knex/objection.js. Maybe you should contact your hosting service. – Mikael Lepistö Sep 09 '20 at 07:31
  • @MikaelLepistö I check my models, the problem in the number of models. I have about 200+models and it works slowly ever without relations. So the task how to divide the models on the parts. The task is complicated by the fact that the models are very interconnected – befreeforlife Sep 09 '20 at 10:49
  • I missed that you were using graphql... that might cause problems with overly complicated relation setups... though that error message you added is not related. – Mikael Lepistö Sep 10 '20 at 11:21

0 Answers0