Creating graph in gds

New to this and practicing creating subgraphs with gds.
My simple objective is to create a subgraph of recipes that have capers and are main courses. Per the documentation I need to define id, source and target. I am not completely clear how to assign target since in this query in the browser is
MATCH (:Ingredient{name:"capers"})-[:HAS_INGREDIENT]-(a:Dish)-[:DISH_TYPE]-(b:DishType{name:"main course"}) RETURN a
Works as intended.

I have tried to assign it more or less as a dummy variable since it is required. BUT this does not work.
with a failed to load relationship with unknown target-node id 3660.

CALL gds.graph.create.cypher('caper_main',
'Match (a:Dish) RETURN id(a) as id, as recipe',
'MATCH (:Ingredient{name:"capers"})-[:HAS_INGREDIENT]-(a:Dish)-[:DISH_TYPE]-(b:DishType{name:"main course"}) RETURN id(a) AS source, id(b) AS target')

What am I missing?

The subgraph will be in memory. Is it in the list of available graphs after you run the above create?

call gds.graph.list()

If so, have you tried querying it? Something like:

YIELD nodeId, communityId, intermediateCommunityIds
RETURN nodeId, communityId, intermediateCommunityIds

Hi genealogy,

The graph is not in memory as per gds.graph.list().

Made a tweak but not sure what I am getting. Changed the node query to 'MATCH (a) RETURN id(a) AS id'
It returns a node count of 3682 which is all the nodes in the database and 134 relationships. When I run from the browser I get 134 nodes.

CALL gds.graph.create.cypher('capers', 'MATCH (a) RETURN id(a) AS id', 'MATCH (Ingredient{name:"capers"})-[:HAS_INGREDIENT]-(a:Dish)-[:DISH_TYPE]-(b:DishType{name:"main course"}) RETURN id(a) as source, id(b) AS target')

If I do this as the node query

'MATCH (a:Dish) RETURN id(a) AS id',

I get an error which references node id 3660.
If I do:

Match (a)
WHERE id(a)=3660

It returns the node for DishType{name:'main course}

Is this the correct expectation of how it should work? I am confused.

You have a blank space in the node name. In this case, try using  backtick:

(b:DishType{name:`main course`})