Open alizhdanov opened 4 years ago
Therefore it is currently also not usable with graphql-modules, if you have at least two nexus modules
The assumption of nexus is that there is one schema per typescript project. If you use a lerna/yarn workspaces style monorepo, it should work if you have the generated types emitted into separate projects. I currently use this approach with an "admin" schema which is a superset of the "public" schema. In order for this to work you need to manually specify the output paths for these modules.
I'm not sure about graphql-modules.
@tgriesser Why is typescripts declaration merging not working? I do not get it exactly.
Because the shape of how we define types currently makes them un-mergeable. IIRC the original thought was to centralize on a single interface and then pass that down as a default parameter to be able to get to the types via conditionals.
I'm not certain if this is actually necessary still with how we're inferring them now via the globals and "materializing" the types dynamically via infer
, it's been on the todo list of design assumptions to revisit.
Hello, I have two schemas in one project (just for example -
schema1
andschema2
). Each of them has it's ownnexus-typegen
generated file. Types forschema1
are working fine, the issue withschema2
. For instance when I wanna create newmutationField
:It'd show typescript error that
type '"Doughnut"' is not assignable to type ...
. The issue that this type defined inschema2
, but not inschema1
. But types always checked fromschema1
.The issue seems to be, because of
nexus
is dependant on global types defined in@types/nexus-typegen__nexus-core
.In my case I generate, which mean that only one of the file will be applied:
Is it possible somehow to link types manually?