required usecase-response into usecase2mutation #24
Labels
enhancement
New feature or request
hacktoberfest
help wanted
Extra attention is needed
severity-minor
Item is not urgent
wip
Work in progress
Problem
I'm trying to use
usecase2mutation
with an usecase that don't needs a response, but theusecase2mutation
requires itmy usecase:
when I transform it using
usecase2mutation(usecase, defaultResolver(usecase)
I got this error:it says that my usecase needs an response type,I tried use null but I got the same error.
Solution
I believe we can create an
scalar Void
type by default into the default schema, so we can use it when a usecase return nothing.Inside useCaseValidator we can remove the line 16
const responseValidation = validate(useCase.responseSchema, defaultValidator)
. So when we get a usecase without response type into usecaseResponse2gql we can returnVoid
the final result will be somethinkg like
here we have an clear explanation about the solution https://stackoverflow.com/a/61714123
The text was updated successfully, but these errors were encountered: