Created
August 18, 2019 18:50
-
-
Save lssweatherhead/2d3a3edb9f007e71dbdfa20b7f7d36a7 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 CarbonFootprintVariantGraphType: ObjectGraphType<Variant> | |
{ | |
public CarbonFootprintVariantGraphType() | |
{ | |
Name = "CarbonFootprintItemVariant"; | |
Field<NonNullGraphType<IntGraphType>>( | |
"id", | |
resolve: context => context.Source.Id | |
); | |
Field<NonNullGraphType<StringGraphType>>( | |
"name", | |
resolve: context => context.Source.VariantName | |
); | |
Field<NonNullGraphType<CarbonFootprintItemGraphType>>( | |
"item", | |
resolve: context => ApplicationContext.Current.DatabaseContext.GetItemById(context.Source.Item) | |
); | |
Field<NonNullGraphType<FloatGraphType>>( | |
"carbonDioxideEquivalentInGrams", | |
resolve: context => context.Source.CarbonDioxideEquivalent | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment