Skip to content

Instantly share code, notes, and snippets.

@mczachurski
Created October 10, 2017 13:25
Show Gist options
  • Save mczachurski/b0e167c1070f70e794cfc03a3c8839f5 to your computer and use it in GitHub Desktop.
Save mczachurski/b0e167c1070f70e794cfc03a3c8839f5 to your computer and use it in GitHub Desktop.
public class ResponseListGraphType<TGraphType> : ObjectGraphType<Response> where TGraphType : GraphType
{
public ResponseListGraphType()
{
Name = $"ResponseList{typeof(TGraphType).Name}";
Field(x => x.StatusCode, nullable: true).Description("Status code of the request.");
Field(x => x.ErrorMessage, nullable: true).Description("Error message if requests fails.");
Field<ListGraphType<TGraphType>>(
"data",
"Project data returned by query.",
resolve: context => context.Source.Data
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment