Created
October 10, 2017 08:02
-
-
Save mczachurski/73968cb71464af331aa6b7daea19afb2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ResponseGraphType<TGraphType> : ObjectGraphType<Response> where TGraphType : GraphType | |
{ | |
public ResponseGraphType() | |
{ | |
Name = $"Response{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<TGraphType>( | |
"data", | |
"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