Skip to content

Instantly share code, notes, and snippets.

@mczachurski
Created October 10, 2017 08:14
Show Gist options
  • Save mczachurski/3729efd0ddf24320e2c15e7168453b19 to your computer and use it in GitHub Desktop.
Save mczachurski/3729efd0ddf24320e2c15e7168453b19 to your computer and use it in GitHub Desktop.
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