Description
Hi @wravery, it's me again :-) In order to avoid large PR being dropped, I'm opening this issue to get your feeling:
Currently the separate
will use a single huge header full of templates that makes the compilation of large schemas painful slow. Example:
- https://github.com/microsoft/cppgraphqlgen/blob/main/samples/separate/AppointmentConnectionObject.cpp
- includes https://github.com/microsoft/cppgraphqlgen/blob/main/samples/separate/TodayObjects.h
- includes all objects, ex: https://github.com/microsoft/cppgraphqlgen/blob/main/samples/separate/QueryObject.h of which will declare all methods and all.
but most (all?) of them are not needed. AppointmentConnection
, for instance, uses https://github.com/microsoft/cppgraphqlgen/blob/main/samples/separate/AppointmentEdgeObject.h but it seems the AppointmentEdge
is handled as shared pointer and no direct member access is done.
I didn't try to change any files yet, but I wonder if we could avoid such full types and replace them with forward declarations whenever possible.
Also, as we're a generator and we know the dependencies, we could emit just the forward declarations for the types used in that file, reducing the compilation time.