From b7bed9533bdded7af92289b322584471a2c7eb0a Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Tue, 3 Jan 2023 18:37:32 +1030 Subject: [PATCH] graph/encoding/graphql: note requirement of dst parameter The spanning tree walk sets nodes' IDs using the SetIDFromString method so note that nodes returned by the destination's NewNode method must satisfy StringIDSetter. --- graph/encoding/graphql/decode.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graph/encoding/graphql/decode.go b/graph/encoding/graphql/decode.go index d0e2ee06..3ebea46c 100644 --- a/graph/encoding/graphql/decode.go +++ b/graph/encoding/graphql/decode.go @@ -17,7 +17,8 @@ import ( // Unmarshal parses the JSON-encoded data and stores the result in dst. // Node IDs are obtained from the JSON fields identified by the uid parameter. // UIDs obtained from the JSON encoding must map to unique node ID values -// consistently across the JSON-encoded spanning tree. +// consistently across the JSON-encoded spanning tree. graph.Node values +// returned by dst.NewNode must satisfy StringIDSetter. func Unmarshal(data []byte, uid string, dst encoding.Builder) error { if uid == "" { return errors.New("graphql: invalid UID field name")