Skip to content

Commit da73e84

Browse files
authored
Added test for query using a source-generated DataLoader interface (#8664)
1 parent 6e5595f commit da73e84

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/HotChocolate/Core/test/Types.Analyzers.Tests/IntegrationTests.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,36 @@ public async Task Inherit_Interface_Fields()
133133
result.MatchMarkdownSnapshot();
134134
}
135135

136+
[Fact]
137+
public async Task Query_Using_DataLoader_Interface()
138+
{
139+
// arrange
140+
var services = CreateApplicationServices();
141+
var executor = await services.GetRequiredService<IRequestExecutorProvider>().GetExecutorAsync();
142+
143+
// act
144+
var result = await executor.ExecuteAsync(
145+
"""
146+
{
147+
authorById(id: "QXV0aG9yOjE=") {
148+
someInfo
149+
}
150+
}
151+
""");
152+
153+
// assert
154+
result.MatchInlineSnapshot(
155+
"""
156+
{
157+
"data": {
158+
"authorById": {
159+
"someInfo": "1 - some info"
160+
}
161+
}
162+
}
163+
""");
164+
}
165+
136166
private static IServiceProvider CreateApplicationServices(
137167
Action<IServiceCollection>? configure = null)
138168
{

0 commit comments

Comments
 (0)