graphql-dotnet / graphql-dotnet/conventions
Error when getting enum value => Argument 'input' has invalid value
- Dominant language
- C#
- Stars
- 228
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
I'm using the conventions library as a mock server, and I couldn't figure out how to map values, here's a query example
`
test(input: {
accountName: "Compte principal"
name: "test"
companyType: Association // this is an enum as you can see not a string value
businessActivity: AdministrativeServices // same
monthlyPaymentVolume: Between10000And50000 // same
email: "test@test.com"
language: "FR"
}) {
... onSuccessPayload {
__typename
status
}
... on BadRequestRejection {
__typename
message
}
... on ValidationRejection {
__typename
message
}
... on ForbiddenRejection {
__typename
message
}
}
}
`
And i'm using a I'm only using a requestHandler, so when i get a request I pass it to requestHandler.ProcessRequestAsync.
I have a workaround to pass the enum as string value and then parse it, but i'd rather not.
here's the full error I got:
In field 'businessActivity': [Expected type 'BusinessActivity', found AdministrativeServices.] In field 'monthlyPaymentVolume': [Expected type 'MonthlyPaymentVolume', found Between10000And50000.]\",\"locations\":[{\"line\":2,\"column\":31}],\"extensions\":{\"code\":\"FIELD_RESOLUTION\",\"codes\":[\"FIELD_RESOLUTION\",\"ARGUMENTS_OF_CORRECT_TYPE_ERROR\"]}}]
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.