Skip to content

Commit 2b332ca

Browse files
Add test
1 parent fd08b50 commit 2b332ca

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Planning/OperationPlannerTests.cs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,61 @@ query GetTopProducts {
148148
MatchSnapshot(plan);
149149
}
150150

151+
[Fact]
152+
public void Plan_Simple_Abstract_Lookup()
153+
{
154+
// arrange
155+
var schema = ComposeSchema(
156+
"""
157+
schema @schemaName(value: "A") {
158+
query: Query
159+
}
160+
161+
type Query {
162+
topProducts: [Product!]
163+
}
164+
165+
type Product {
166+
id: ID!
167+
name: String!
168+
}
169+
""",
170+
"""
171+
schema @schemaName(value: "B") {
172+
query: Query
173+
}
174+
175+
type Query {
176+
node(id: ID!): Node @lookup @internal
177+
}
178+
179+
interface Node {
180+
id: ID!
181+
}
182+
183+
type Product implements Node {
184+
id: ID!
185+
price: Float!
186+
}
187+
""");
188+
189+
// act
190+
var plan = PlanOperation(
191+
schema,
192+
"""
193+
query GetTopProducts {
194+
topProducts {
195+
id
196+
name
197+
price
198+
}
199+
}
200+
""");
201+
202+
// assert
203+
MatchSnapshot(plan);
204+
}
205+
151206
[Fact]
152207
public void Plan_Simple_Requirement()
153208
{

0 commit comments

Comments
 (0)