Replies: 1 comment 2 replies
-
In GraphQL, input objects have a separate type in the system because object types can contain fields that express circular references or references to interfaces and unions, neither of which are appropriate for use as input arguments. That's why TypeGraphQL doesn't have a dedicated mechanism to reuse or convert object types to input types automatically.
You should put the |
Beta Was this translation helpful? Give feedback.
-
Hello,
In my case, GraphQL input of class are useless because I'm creating my own input in my dto folder.
But this does not seem to be enough, if the
@InputType
decorator is not also in the entity, an error occurs.The problem is that by putting it on, it creates an input with the whole class in the GraphQL schema (which is useless in my case).
Here,
BrandInput
is useless, cause for creating a new Brand, I'm gonna use my own input,CreateBrandInput
.But If I'm removing the
@InputType
in the filebrand.model.ts
, I've got an error (Error: Cannot determine a GraphQL input type for the "brand")Am I doing something wrong?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions