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
{ | |
"data": { | |
"project": { | |
"statusCode": "Success", | |
"errorMessage": null, | |
"data": { | |
"id": "projectA", | |
"name": "Project A", | |
"visibleBranches": [ | |
"Latest" |
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
{ | |
"data": { | |
"project": { | |
"statusCode": "NotFound", | |
"errorMessage": "Resource not found", | |
"data": null | |
}, | |
"projects": { | |
"statusCode": "Success", | |
"errorMessage": null, |
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 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>( |
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 Response | |
{ | |
public object Data { get; set; } | |
public string StatusCode { get; set; } | |
public string ErrorMessage { get; set; } | |
public Response(object data) | |
{ | |
StatusCode = "Success"; | |
Data = data; |
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 BranchesResolver : IBranchesResolver | |
{ | |
private readonly IBranchesService _branchesService; | |
public BranchesResolver(IBranchesService branchesService) | |
{ | |
_branchesService = branchesService; | |
} | |
public void Resolve(GraphQLQuery graphQLQuery) |
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 Resolver | |
{ | |
public Response Response(object data) | |
{ | |
return new Response(data); | |
} | |
public Response Error(GraphQLError error) | |
{ | |
return new Response(error.StatusCode, error.ErrorMessage); |
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 BranchesResolver : Resolver, IBranchesResolver | |
{ | |
private readonly IBranchesService _branchesService; | |
public BranchesResolver(IBranchesService branchesService) | |
{ | |
_branchesService = branchesService; | |
} | |
public void Resolve(GraphQLQuery graphQLQuery) |
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 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>>( |
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 BranchesResolver : Resolver, IBranchesResolver | |
{ | |
private readonly IBranchesService _branchesService; | |
public BranchesResolver(IBranchesService branchesService) | |
{ | |
_branchesService = branchesService; | |
} | |
public void Resolve(GraphQLQuery graphQLQuery) |
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 GraphQLParameter | |
{ | |
public string Query { get; set; } | |
} |
OlderNewer