Created
August 18, 2019 18:44
-
-
Save lssweatherhead/4b46111a2732a6fbc870efc4421967f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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