| 79 | } |
| 80 | |
| 81 | func (o *Object) ProjectMetadata(sctx *super.Context, projection field.Projection) []super.Value { |
| 82 | var b scode.Builder |
| 83 | var values []super.Value |
| 84 | root := o.cctx.Lookup(o.Root()) |
| 85 | if root, ok := root.(*Dynamic); ok { |
| 86 | for _, id := range root.Values { |
| 87 | b.Reset() |
| 88 | typ := metadataValue(o.cctx, sctx, &b, id, projection) |
| 89 | values = append(values, super.NewValue(typ, b.Bytes().Body())) |
| 90 | } |
| 91 | } else { |
| 92 | typ := metadataValue(o.cctx, sctx, &b, o.Root(), projection) |
| 93 | values = append(values, super.NewValue(typ, b.Bytes().Body())) |
| 94 | } |
| 95 | return values |
| 96 | } |