0
@Mutation((returns) => StyleOperationHead)
async saveStyleOperationHead(
@Args('styleOperationHeadData')
 styleOperationHeadData: StyleOperationHeadInputDto,
): Promise<StyleOperationHead> {

console.log(styleOperationHeadData)

return {
  operationId: 1,
  style: 'HSF222005A',
  color: 'RED',
  structureType: 1,
  baseTemplateId: 1,
  numberOfJobGroups: 3,
  totalSmv: 54,
};

}

I have the above mutation written in a resolver class in my graphql project.

I use the below query to call the above endpoint

# Write your query or mutation here

mutation {
   saveStyleOperationHead(styleOperationHeadData: {
       style: "HSF222005A"
       color: "RED"
       structureType: 1
       baseTemplateId: 1
       numberOfJobGroups: 3
       totalSmv: 54
  }
) {
   operationId
   style
   color
   structureType
   baseTemplateId
   numberOfJobGroups
   totalSmv
}
}

Issue here is fields in the incoming request(query) always is empty. In the console log I have put I get this empty output-> StyleOperationHeadInputDto {}

I have checked my models and dtos , there are no discrepancies there wrt the request.

Can anyone tell me what I am doing wrong here ?

0 Answers0