Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.