Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 committed Aug 4, 2024
1 parent b123202 commit f77acba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ namespace GraphQL.Server.Transports.AspNetCore.Errors
public FileSizeExceededError() { }
public System.Net.HttpStatusCode PreferredStatusCode { get; set; }
}
public class HttpMethodValidationError : GraphQL.Validation.ValidationError
public class HttpMethodValidationError : GraphQL.Validation.ValidationError, GraphQL.Server.Transports.AspNetCore.Errors.IHasPreferredStatusCode
{
public HttpMethodValidationError(GraphQLParser.ROM originalQuery, GraphQLParser.AST.ASTNode node, string message) { }
public System.Net.HttpStatusCode PreferredStatusCode { get; set; }
}
public interface IHasPreferredStatusCode
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,10 @@ namespace GraphQL.Server.Transports.AspNetCore.Errors
public FileSizeExceededError() { }
public System.Net.HttpStatusCode PreferredStatusCode { get; set; }
}
public class HttpMethodValidationError : GraphQL.Validation.ValidationError
public class HttpMethodValidationError : GraphQL.Validation.ValidationError, GraphQL.Server.Transports.AspNetCore.Errors.IHasPreferredStatusCode
{
public HttpMethodValidationError(GraphQLParser.ROM originalQuery, GraphQLParser.AST.ASTNode node, string message) { }
public System.Net.HttpStatusCode PreferredStatusCode { get; set; }
}
public interface IHasPreferredStatusCode
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ namespace GraphQL.Server.Transports.AspNetCore.Errors
public FileSizeExceededError() { }
public System.Net.HttpStatusCode PreferredStatusCode { get; set; }
}
public class HttpMethodValidationError : GraphQL.Validation.ValidationError
public class HttpMethodValidationError : GraphQL.Validation.ValidationError, GraphQL.Server.Transports.AspNetCore.Errors.IHasPreferredStatusCode
{
public HttpMethodValidationError(GraphQLParser.ROM originalQuery, GraphQLParser.AST.ASTNode node, string message) { }
public System.Net.HttpStatusCode PreferredStatusCode { get; set; }
}
public interface IHasPreferredStatusCode
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Samples.Authorization.Tests/EndToEndTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public Task GraphQLGet_Success()

[Fact]
public Task GraphQLGet_AccessDenied()
=> new ServerTests<Program>().VerifyGraphQLGetAsync("/graphql", ACCESS_DENIED_QUERY, ACCESS_DENIED_RESPONSE, HttpStatusCode.BadRequest);
=> new ServerTests<Program>().VerifyGraphQLGetAsync("/graphql", ACCESS_DENIED_QUERY, ACCESS_DENIED_RESPONSE, HttpStatusCode.Unauthorized);

[Fact]
public Task GraphQLPost_Success()
=> new ServerTests<Program>().VerifyGraphQLPostAsync("/graphql", SUCCESS_QUERY, SUCCESS_RESPONSE);

[Fact]
public Task GraphQPost_AccessDenied()
=> new ServerTests<Program>().VerifyGraphQLPostAsync("/graphql", ACCESS_DENIED_QUERY, ACCESS_DENIED_RESPONSE, HttpStatusCode.BadRequest);
=> new ServerTests<Program>().VerifyGraphQLPostAsync("/graphql", ACCESS_DENIED_QUERY, ACCESS_DENIED_RESPONSE, HttpStatusCode.Unauthorized);

[Fact]
public Task GraphQLWebSocket_Success()
Expand Down

0 comments on commit f77acba

Please sign in to comment.