public function buildGraph(array $userSchema)
    {
        $graphSchema = new GraphSchema();
        foreach ($userSchema['nodes'] as $id => $nodeInfo) {
            $node = $this->buildNode($id, $nodeInfo);
            $graphSchema->addNode($node);
        }
        if (!isset($userSchema['relationships'])) {
            $userSchema['relationships'] = [];
        }
        foreach ($userSchema['relationships'] as $rel) {
            $relationship = $this->buildRelationship($rel);
            $graphSchema->addRelationship($relationship);
        }

        return $graphSchema;
    }