CREATE (f:Foo)-[rel:FOOBAR {a:1}]->(b:Bar)
We pass the ID of the relationship as parameter to extract a node
MATCH (f:Foo)-[rel:FOOBAR {a:1}]->(b:Bar) WITH id(rel) as id
CALL apoc.refactor.extractNode(id,['FooBar'],'FOO','BAR')
YIELD input, output RETURN *