package graphql

import "gonum.org/v1/gonum/graph/encoding/graphql"

Package graphql implements JSON marshaling and unmarshaling of graph as used by GraphQL

Index

Functions

func Unmarshal

func Unmarshal(data []byte, uid string, dst encoding.Builder) error

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. graph.Node values returned by dst.NewNode must satisfy StringIDSetter.

Types

type LabelSetter

type LabelSetter interface {
	SetLabel(string)
}

LabelSetter is a graph edge that can set its label.

type StringIDSetter

type StringIDSetter interface {
	SetIDFromString(uid string) error
}

StringIDSetter is a graph node that can set its ID based on the given uid string.

Source Files

decode.go doc.go graphql.go

Version
v0.15.1 (latest)
Published
Aug 16, 2024
Platform
linux/amd64
Imports
6 packages
Last checked
12 hours ago

Tools for package owners.