How to properly type-check with multiple endpoints in one project? #1039
Unanswered
arturenault
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We currently have two graphql endpoints (admin and client). Each of which has similar routes, but uses different arguments. They're working fine in our services, but we recently discovered that type checking was disabled in our builds. After enabling it, we started seeing errors like this:
But the args for that field include a saleProcessingState:
What seems to be happening is that the type checking is getting confused between the arg types from the client schema and those from the admin schema. Here are the args for a field with the same name in the admin schema:
I would expect it to be able to differentiate the two, since the generated types end up in different modules in different directories. In production, I assume this is working because we explicitly point to the generated code when creating the Apollo server.
Is there a way to get the type checking to differentiate between the two schemas? Or is the best practice here to build each schema completely independently?
Beta Was this translation helpful? Give feedback.
All reactions