Why HotChocolate does not use the input typename instead of described type name?

Why HotChocolate does not use the input typename instead of described type name?


0

I have the following mutation in my schema which uses DocumentGraphQlInput as input type. But when I take a look at the schema in StrawberryShake I see that the type name is used (with Input suffix) which is described as DocumentGraphQlInput.

What I describe below is the right behaviour and my expectations a wrong, or this is a bug?

public class AddDocumentMutation : ObjectTypeExtension<Mutation>
{
    protected override void Configure(IObjectTypeDescriptor<Mutation> descriptor)
    {
        descriptor
            .Field("addDocument")
            .Type<NonNullType<DocumentGraphqlOutput>>()
            .Description("Recording new documents in the system")
            .Argument("newDocument", arg => arg.Type<NonNullType<DocumentGraphqlInput>>())
            .ResolveWith<DocumentResolvers>(documentResolvers => documentResolvers.AddAsync(default, default));
    }
}

Where DocumentGraphqlInput looks like below:

public class DocumentGraphqlInput : InputObjectType<DocumentInputContract>
{
    protected override void Configure(IInputObjectTypeDescriptor<DocumentInputContract> descriptor)
    {
        descriptor
            .Field(f => f.Id)
            .Description("Unique identifier of the entity")
            .Type<NonNullType<LongType>>();

        descriptor
            .Field(f => f.Name)
            .Description("Name of the entity")
            .Type<NonNullType<StringType>>();

        descriptor
            .Field(f => f.Description)
            .Description("Description of the entity")
            .Type<StringType>();

        descriptor
            .Field(f => f.Uri)
            .Description("The source url of the document")
            .Type<StringType>();
    }
}

But, StrawberryShake shows this:

type Mutation {
  """
  Recording new documents in the system
  """
  addDocument(newDocument: DocumentInputContractInput!): DocumentOutputContract!
}

However, it should be, I think, rather this:

type Mutation {
  """
  Recording new documents in the system
  """
  addDocument(newDocument: DocumentGraphqlInput!): DocumentGraphqlOutput!
}


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *