Hi,
I am using EF Core with hotchocolate. So for example for a company I use a query something like this:
[UsePaging]
[UseSelection]
[UseFiltering]
[UseSorting]
public IQueryable<Company> GetCompanies(
[Service] ApplicationDbContext dbContext) =>
dbContext.Companies;
So now assume I have a field in the table I do not want to transport, let's name this field SecretFlag. This is purely used in the backend and has nothing to do in the frontend (and should not be queryable).
We add to the Query by attribute ([ExtendObjectType(Name = "MyQuery")].
Thanks for any answer!
@sascha-andres You can either create a ObjectType
Worked.
@PascalSenn thanks for your help
GraphQLIngore
[GraphQLIgnore] correct typo.
It should be in documentation.
Most helpful comment
@sascha-andres You can either create a ObjectType and Ignore the field or you just use the attribute [GraphQLIngore] on the desired property on Company