Skip to content

Failed to generate optionalNonNullArg of enum type #350

@KaStrzelecki

Description

@KaStrzelecki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions