Skip to content

Mutations don't work with an enum #1

@HeinPauwelyn

Description

@HeinPauwelyn

I want to create a request on out 4me tenant and setting the category on RequestCategory.Incident when executing the mutation, I've got next error and stack trace:

Sdk4me.GraphQL.Sdk4meException: Variable $input of type RequestCreateInput! was provided invalid value for category (Invalid value for RequestCategory: '4'. Please supply one of: 'incident', 'rfc', 'rfi', 'reservation', 'order', 'fulfillment', 'complaint', 'compliment', 'other')
   at Sdk4me.GraphQL.Sdk4meClient.<SendHttpRequest>d__36.MoveNext()
   at Sdk4me.GraphQL.Sdk4meClient.<Mutation>d__31`2.MoveNext()
   at Sdk4me.GraphQL.Sdk4meClient.<Mutation>d__30`2.MoveNext()
   at Sdk4me.GraphQL.Sdk4meClientMutationExtension.<Mutation>d__128.MoveNext()
   at Program.<<Main>$>d__0.MoveNext() in C:\**\ConsoleApp1\Program.cs:line 17

Below a minimal but complete piece of code to reproduce the error:

using Sdk4me.GraphQL;

Sdk4meClient sdk4MeClient = new(
    new AuthenticationToken ("<enter-pat-here>"),
    "<enter-account-name-here>",
    EnvironmentType.Quality,
    EnvironmentRegion.EU
);

RequestCreateInput requestCreateInput = new RequestCreateInput()
{
    Subject = "Test",
    Note = "# Something to test",
    Category = RequestCategory.Incident
};

RequestCreatePayload requestCreatePayload = await sdk4MeClient.Mutation(requestCreateInput);

Console.WriteLine(requestCreatePayload.Request?.RequestId);
Console.Write("Press enter key to exit ");
Console.Read();
  • .NET version: .NET 6.0
  • Package version: 1.0.2

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions