๐ŸŒŠ A GraphQL implementation in Gleam

fix(executor): unwrap NonNull before checking union type in list items

The executor was checking is_union() on the inner type of list items,
but after unwrapping List[NonNull[Union]], the inner type is still
NonNull[Union], not Union directly. is_union() only returns true for
direct UnionType, so union type resolution was being skipped.

Now we unwrap one more level before checking is_union(), allowing
inline fragments on union types within arrays to resolve correctly.

Changed files
+9 -3
src
+9 -3
src/swell/executor.gleam
··· 576 576 value.List(items) -> { 577 577 // Handle list with nested selections 578 578 // Get the inner type from the LIST wrapper, unwrapping NonNull if needed 579 + // Field type could be: NonNull[List[NonNull[Union]]] or List[NonNull[Union]] etc. 579 580 let inner_type = case 580 581 schema.inner_type(field_type_def) 581 582 { ··· 595 596 let results = 596 597 list.map(items, fn(item) { 597 598 // Check if inner_type is a union and resolve it 598 - let item_type = case 599 - schema.is_union(inner_type) 599 + // Need to unwrap NonNull to check for union since inner_type 600 + // could be NonNull[Union] after unwrapping List[NonNull[Union]] 601 + let unwrapped_inner = case schema.inner_type(inner_type) { 602 + option.Some(t) -> t 603 + option.None -> inner_type 604 + } 605 + let item_type = case schema.is_union(unwrapped_inner) 600 606 { 601 607 True -> { 602 608 // Create context with the item value for type resolution ··· 604 610 schema.context(option.Some(item)) 605 611 case 606 612 schema.resolve_union_type( 607 - inner_type, 613 + unwrapped_inner, 608 614 resolve_ctx, 609 615 ) 610 616 {