Skip to content

Query unable generate Input argument with Gql Enum type array. #23

@jmingli

Description

@jmingli

Input argument with enum array "sex: [Sex!] = null"

input FilterBy {
  field: String!
  value: String!
  sex: [Sex!] = null
}

Test:

public void TestComplexListEnumArg()
{
	TestClient client = new TestClient();
	QueryRequest query = client.MakeQuery(q => new
	{
		Producers = q.Producers(new FilterBy { Sex = new List<Sex>() { Sex.Male } }, s => new
		{
			s.Id,
			s.LastName
		}),
	});
	Assert.Equal($@"query BaseGraphQLClient($a0: {{ sex: [""Male""] }}) {{
Producers: producers(filter: $a0) {{
Id: id
LastName: lastName
}}
}

Result:

System.ArgumentException : Can't find GQL type for Dotnet type 'Sex'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions