···567 option.Some(t) -> t
568 option.None -> field_type_def
569 }
570- let type_to_use = case schema.is_union(unwrapped_type)
0571 {
572 True -> {
573 // Create context with the field value for type resolution
···567 option.Some(t) -> t
568 option.None -> field_type_def
569 }
570+ let type_to_use = case
571+ schema.is_union(unwrapped_type)
572 {
573 True -> {
574 // Create context with the field value for type resolution
+31-29
test/executor_test.gleam
···1375 // Create query type returning a list of edges
1376 let query_type =
1377 schema.object_type("Query", "Root query type", [
1378- schema.field("notifications", schema.list_type(edge_type), "Get notifications", fn(
1379- _ctx,
1380- ) {
1381- Ok(
1382- value.List([
1383- value.Object([
1384- #(
1385- "node",
1386- value.Object([
1387- #("type", value.String("Like")),
1388- #("uri", value.String("at://user/like/1")),
1389- ]),
1390- ),
1391- #("cursor", value.String("cursor1")),
00000000000001392 ]),
1393- value.Object([
1394- #(
1395- "node",
1396- value.Object([
1397- #("type", value.String("Follow")),
1398- #("uri", value.String("at://user/follow/1")),
1399- ]),
1400- ),
1401- #("cursor", value.String("cursor2")),
1402- ]),
1403- ]),
1404- )
1405- }),
1406 ])
14071408 let test_schema = schema.schema(query_type, None)
···1445 // __typename should be "Like" (resolved from union)
1446 case list.key_find(node_fields, "__typename") {
1447 Ok(value.String("Like")) -> should.be_true(True)
1448- Ok(value.String(other)) ->
1449- should.equal(other, "Like")
1450 _ -> should.fail()
1451 }
1452 // uri should be resolved from inline fragment
···1375 // Create query type returning a list of edges
1376 let query_type =
1377 schema.object_type("Query", "Root query type", [
1378+ schema.field(
1379+ "notifications",
1380+ schema.list_type(edge_type),
1381+ "Get notifications",
1382+ fn(_ctx) {
1383+ Ok(
1384+ value.List([
1385+ value.Object([
1386+ #(
1387+ "node",
1388+ value.Object([
1389+ #("type", value.String("Like")),
1390+ #("uri", value.String("at://user/like/1")),
1391+ ]),
1392+ ),
1393+ #("cursor", value.String("cursor1")),
1394+ ]),
1395+ value.Object([
1396+ #(
1397+ "node",
1398+ value.Object([
1399+ #("type", value.String("Follow")),
1400+ #("uri", value.String("at://user/follow/1")),
1401+ ]),
1402+ ),
1403+ #("cursor", value.String("cursor2")),
1404+ ]),
1405 ]),
1406+ )
1407+ },
1408+ ),
00000000001409 ])
14101411 let test_schema = schema.schema(query_type, None)
···1448 // __typename should be "Like" (resolved from union)
1449 case list.key_find(node_fields, "__typename") {
1450 Ok(value.String("Like")) -> should.be_true(True)
1451+ Ok(value.String(other)) -> should.equal(other, "Like")
01452 _ -> should.fail()
1453 }
1454 // uri should be resolved from inline fragment