mercurius-js / mercurius

Implement GraphQL servers and gateways with Fastify
https://mercurius.dev/
MIT License
2.35k stars 237 forks source link

Explicitly say in the docs that JIT is disabled by default #901

Closed igrlk closed 2 years ago

igrlk commented 2 years ago

I think that's a good thing to mention that JIT is disabled by default and should be explicitly enabled to get the performance benefits. I personally thought that it's enabled by default, but then I started digging into Mercurius and found how JIT is actually used there, and that it's not enabled by default.

Screenshot of the updated docs:

Screenshot 2022-10-29 at 21 21 04
igrlk commented 2 years ago

Also curious, why not is not enabled by default? Interesting to hear code owners vision on things like JIT and other plugins - are they just an addition or things like jit considered as main features?

Really keen to know what you think about it, especially because of @defer in Mercurius PR that's kind of blocked by JIT not working properly with @defer - should it be even considered as blocker or no?

smolinari commented 2 years ago

I personally think JIT is a feature that is a main selling point for Mercurius. It's where it's superior performance comes from. That being said, JIT is only really interesting in a system running in production. As long as code is changing (i.e. during development), JIT is less important. I'm wondering though, does "0" calls of a query to JIT it mean JIT is completely off, or does it mean it is always on? :grin:

But for sure, it would be a good idea to mention it being "0" as default (and note what that means), since all defaults should be mentioned for configs and most are for the other plugin options.

Scott