Skip to content

Commit 26f0234

Browse files
committed
Restore test
1 parent eb22dec commit 26f0234

1 file changed

Lines changed: 38 additions & 39 deletions

File tree

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/IntrospectionTests.cs

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -112,45 +112,44 @@ public async Task Introspection_OfType_Depth_1_BadRequest()
112112
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
113113
}
114114

115-
// FIXME: Conflict with ASP.NET validation source generator.
116-
// [Fact]
117-
// public async Task Introspection_OfType_Depth_1_Depth_Analysis_Disabled()
118-
// {
119-
// // arrange
120-
// var server = CreateStarWarsServer(
121-
// configureServices: s => s
122-
// .AddGraphQL()
123-
// .SetIntrospectionAllowedDepth(
124-
// maxAllowedOfTypeDepth: 1,
125-
// maxAllowedListRecursiveDepth: 1)
126-
// .Services
127-
// .AddValidation()
128-
// .ConfigureValidation(b => b.Modifiers.Add(o => o.DisableDepthRule = true)));
129-
130-
// var request = new GraphQLHttpRequest(
131-
// new OperationRequest(
132-
// """
133-
// {
134-
// __schema {
135-
// types {
136-
// ofType {
137-
// ofType {
138-
// name
139-
// }
140-
// }
141-
// }
142-
// }
143-
// }
144-
// """),
145-
// new Uri("http://localhost:5000/graphql"));
146-
147-
// // act
148-
// var client = new DefaultGraphQLHttpClient(server.CreateClient());
149-
// using var response = await client.SendAsync(request);
150-
151-
// // assert
152-
// Assert.Equal(HttpStatusCode.OK, response.StatusCode);
153-
// }
115+
[Fact]
116+
public async Task Introspection_OfType_Depth_1_Depth_Analysis_Disabled()
117+
{
118+
// arrange
119+
var server = CreateStarWarsServer(
120+
configureServices: s => s
121+
.AddGraphQL()
122+
.SetIntrospectionAllowedDepth(
123+
maxAllowedOfTypeDepth: 1,
124+
maxAllowedListRecursiveDepth: 1)
125+
.Services
126+
.AddValidation()
127+
.ConfigureValidation(b => b.Modifiers.Add(o => o.DisableDepthRule = true)));
128+
129+
var request = new GraphQLHttpRequest(
130+
new OperationRequest(
131+
"""
132+
{
133+
__schema {
134+
types {
135+
ofType {
136+
ofType {
137+
name
138+
}
139+
}
140+
}
141+
}
142+
}
143+
"""),
144+
new Uri("http://localhost:5000/graphql"));
145+
146+
// act
147+
var client = new DefaultGraphQLHttpClient(server.CreateClient());
148+
using var response = await client.SendAsync(request);
149+
150+
// assert
151+
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
152+
}
154153

155154
[Fact]
156155
public async Task Introspection_Disabled_BadRequest()

0 commit comments

Comments
 (0)