-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
Hi,
I get results like left join while doing nested query
query {
products {
items {
productCode
productName
client {
clientCode
clientName
}
}
}
}
query {
clients {
items {
clientCode
clientName
products {
clientCode
}
}
}
}
I would like the ability to do both left and inner join. I just defined relationship in client.cs and product.cs and dbcontext.cs is also updted.
// Configure GraphQL schema with EntityGraphQL
services.AddGraphQLSchema<MediaDBContext>(options =>
{
// Hook into schema building
options.ConfigureSchema = schema =>
{
// Example: add a custom field to Client type
schema.UpdateType<Client>(type =>
{
type.AddField("productCount", c => c.Products.Count(), "Number of products for this client");
});
};
// Apply paging/filter/sort to list fields
options.OnFieldCreated = field =>
{
if (field.FromType?.Name == "Query" && field.ReturnType.IsList &&
field.ReturnType.SchemaType.GqlType == GqlTypes.QueryObject &&
!field.FromType.IsInterface)
{
field.UseFilter()
.UseSort()
.UseOffsetPaging(defaultPageSize: DefaultPageSize, maxPageSize: MaxPages);
}
};
});
I am stuck with the sntax how I can filter like like left or inner join
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels