cppgraphqlgen icon indicating copy to clipboard operation
cppgraphqlgen copied to clipboard

Failed to generate optionalNonNullArg of enum type

Open KaStrzelecki opened this issue 5 months ago • 0 comments
trafficstars

Hi, I tried using optionalNonNullArg as shown here: https://spec.graphql.org/October2021/#sel-JALTFFTB6CABABSnoI with enum type but schemagen failed with

terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at

Code sample to reproduce

enum optionalNonNullEnum {
	One
	Two
}

type optionalNonNullTest_1 {
	test(arg: optionalNonNullEnum! = One) : Boolean!
}

Same error goes for custom input type:

input optionalNonNullInput {
	testField: Int!
}

type optionalNonNullTest_2 {
	test(arg: optionalNonNullInput! = {testField: 1}) : Boolean
}

Boolean/Int/String works fine.

KaStrzelecki avatar Jun 06 '25 15:06 KaStrzelecki