mobxjs / mst-gql

Bindings for mobx-state-tree and GraphQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slow intellisense in VSCode

joelbqz opened this issue · comments

Hi guys, I like this library but unfortunately after I generate the models from Hasura(I have 14 tables) it generates approx. 750 files which make the intellisense very slow. Is there any workaround for this? I tried to specify --roots but had no luck

commented

It is the same with the Intellij IDEs too, although I found that VSCode is still faster.

For me a bigger problem is that compilation of the many MST models is very slow. My current solution for this is that I don't keep my MST generated models in my app, but in a separate package and use "incremental": true in tsconfig.json and then import this module in my app.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#faster-subsequent-builds-with-the---incremental-flag

I also remove most of the aggregate related stuff from the Hasura schema as I don't need them and only keep count, min, max to make the generated MST models lighter:

cat schema.graphql | egrep -v '(avg|stddev|stddev_pop|stddev_samp|sum|var_pop|var_samp|variance):' | \
  sed -e '/#.* avg/,/}/d' | \
  sed -e '/#.* stddev/,/}/d' | \
  sed -e '/#.* stddev_pop/,/}/d' | \
  sed -e '/#.* stddev_samp/,/}/d' | \
  sed -e '/#.* sum/,/}/d' | \
  sed -e '/#.* var_pop/,/}/d' | \
  sed -e '/#.* var_samp/,/}/d' | \
  sed -e '/#.* variance/,/}/d' \
  > cleared-schema.graphql

HI @joelbqz Im helping @jesse-savary organize all the outstanding issues are you still having problems?