Created
October 10, 2017 08:14
-
-
Save mczachurski/3729efd0ddf24320e2c15e7168453b19 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 Resolver | |
{ | |
public Response Response(object data) | |
{ | |
return new Response(data); | |
} | |
public Response Error(GraphQLError error) | |
{ | |
return new Response(error.StatusCode, error.ErrorMessage); | |
} | |
public Response AccessDeniedError() | |
{ | |
var error = new AccessDeniedError(); | |
return new Response(error.StatusCode, error.ErrorMessage); | |
} | |
public Response NotFoundError(string id) | |
{ | |
var error = new NotFoundError(id); | |
return new Response(error.StatusCode, error.ErrorMessage); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment