@@ -11,7 +11,7 @@ import (
11
11
"github.com/ipld/go-ipld-prime/codec/dagjson"
12
12
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
13
13
"github.com/ipld/go-ipld-prime/multicodec"
14
- "github.com/ipld/go-ipld-prime/node/basicnode "
14
+ "github.com/ipld/go-ipld-prime/schema "
15
15
)
16
16
17
17
func (f * Federation ) handleV1FedHead (w http.ResponseWriter , r * http.Request ) {
@@ -58,7 +58,7 @@ func (f *Federation) handleV1FedSubtree(w http.ResponseWriter, r *http.Request)
58
58
59
59
ctx := ipld.LinkContext {Ctx : r .Context ()}
60
60
lnk := cidlink.Link {Cid : c }
61
- node , err := f .linkSystem .Load (ctx , lnk , basicnode . Prototype . Any )
61
+ node , err := f .linkSystem .Load (ctx , lnk , Prototypes . Snapshot )
62
62
if err != nil {
63
63
if errors .Is (err , datastore .ErrNotFound ) || errors .Is (err , ipld.ErrNotExists {}) {
64
64
http .Error (w , "" , http .StatusNotFound )
@@ -68,7 +68,7 @@ func (f *Federation) handleV1FedSubtree(w http.ResponseWriter, r *http.Request)
68
68
http .Error (w , "" , http .StatusInternalServerError )
69
69
return
70
70
}
71
- if err := encoder (node , w ); err != nil {
71
+ if err := encoder (node .(schema. TypedNode ). Representation () , w ); err != nil {
72
72
logger .Errorw ("Failed to encode node" , "err" , err )
73
73
}
74
74
}
0 commit comments