Class: GraphResult

GraphResult

A GraphResult is the answer of a graphdef. It contains the graph patch resulting of the query and all the associated metadata


new GraphResult(id, source, destination, patch)

Parameters:
Name Type Description
id string

the id of the associated graphdef

source string
destination string
patch olympe.dc.db.GraphPatch

Methods


<static> fromJSON(json)

Deserializes a GraphResult from a JSON object or string.

Parameters:
Name Type Description
json string | Object
Returns:
Type
olympe.dc.query.GraphResult

forEachBlock(callback)

Execute the specified callback for each block of this result

Parameters:
Name Type Description
callback function

getDataAs(writableConstructor)

Parameters:
Name Type Description
writableConstructor function

(must extends olympe.dc.Writable)

Deprecated:
Returns:

the writable with all the data of this GraphResult

Type
T

getDestination()

Return the destination of this result

Returns:

the destination id

Type
string

getId()

Returns the id of the graphdef associated to this result

Returns:

the associated graphdef id

Type
string

getPatch()

Return the data of this result as a graph patch.

Returns:

The graph data patch of this result

Type
olympe.dc.db.GraphPatch

newBlock(id, instances)

Creates a new graph query block in this result containing the specified instances. If the block already exists, add the specified instances to it.

Parameters:
Name Type Description
id string
instances Iterable.<string>
Returns:

the block id

Type
string

toJSON()

Serializes this GraphResult into a JSON string.

Returns:
Type
string