Skip to content

Use GraphQLName when referencing type with ID<Type> #6256

@glen-84

Description

@glen-84

Product

Hot Chocolate

Is your feature request related to a problem?

[GraphQLName("Article")]
public sealed class ArticleModel
{

...

[ID<ArticleModel>]
public static async Task<long> DraftArticle(

This uses the name ArticleModel for the ID – could it use the GraphQL name (Article) instead?

The solution you'd like

public IDAttribute()
{
    var type = typeof(T);

    TypeName = type.GetCustomAttribute<GraphQLNameAttribute>()?.Name ?? type.Name;
}

I can send a PR if this makes sense.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions