Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class CarbonFootprintCategoryGraphType : ObjectGraphType<ItemType>
{
public CarbonFootprintCategoryGraphType()
{
Name = "CarbonFootprintCategory";
Field<NonNullGraphType<IntGraphType>>(
"id",
resolve: context => context.Source.Id
);
Field<NonNullGraphType<StringGraphType>>(
"name",
resolve: context => context.Source.Name
);
Field<NonNullGraphType<ListGraphType<CarbonFootprintItemGraphType>>>(
"items",
resolve: context => ApplicationContext.Current.DatabaseContext.GetItemsByCategoryId(context.Source.Id)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.