0

I want my ID fields on the object types automatically infer that they contain ID types based on the information that can be obtained from entity configuration in EF Core. For example, say I define an entity Person in EF Core:

public class Person
{
    public long Id { get; set; }
}

If I now reference this type in Hot Chocolate, it will appear like this in the schema (by default):

type Person {
  id: Long!
}

But I want it to infer ID without extra configuration:

type Person {
  id: ID!
}

Is it possible to reference the EF configuration here? Figuring out which fields are security-sensitive with this approach could also be useful.

Note: it's clear to me that I can define a custom ObjectType implementation and reset the type of the field there, but that would be configuration duplication, which I'm trying to get rid of completely.

0 Answers0