I'm trying to create a mutation that will rely on an input type that has inside of it an input type like this:
input GroupInput {
group_id: String
group_founder_id: String
group_name: String
group_theme_colors: GroupThemeColorsInput
}
input GroupThemeColorsInput {
primary_color: String
secondary_color: String
background_color: String
}
and my mutation looks like this:
createGroup(group: GroupInput): Group
@cypher(
statement:"""MATCH (u:User)
WHERE u.user_id CONTAINS group.group_founder_id
CREATE (u)-[r:CREATED_GROUP]->(g:Group)
SET g = $group
RETURN g
"""
)
When I call the mutation from the front-end it doesn't create the node even though I see that it did call the cypher function in my Log, but if I take the off GroupThemeColorsInput
it works as intended.
This is how I pass the GroupThemeColors
from the front end:
"group_theme_colors": CreateGroup$GroupInput$GroupThemeColorsInput.fromJson(group_Theme_colors).toJson(),
exactly the way I pass any other variable like groupInput
for example, which works as intended without the nested input type group_input : CreateGroup$GroupInput.fromJson(groupJson),
.
So far I'm not sure where the issue is, is it from Neo4j not accepting nested Input types or from Graphql?
P.S. This is the generated cypher function from the Log, it seems to be working as intended but no Node gets created.
CALL apoc.cypher.doIt("MATCH (u:User)
WHERE u.user_id CONTAINS group.group_founder_id
CREATE (u)-[r:CREATED_GROUP]->(g:Group)
SET g = $group
RETURN g ", {group:$group, first:$first, offset:$offset}) YIELD value
WITH apoc.map.values(value, [keys(value)[0]])[0] AS `group`
RETURN `group` { .group_id } AS `group`
{
"group": {
"group_id": "eb037341863afe0a8ebb5b4e6111ebbf",
"group_founder_id": "jQGZu6hdbNPPPaaT9qZuLOHXiK13",
"group_name": "Group_name_test",
"group_theme_colors": {
"primary_color": "Color(0xffffffff)",
"secondary_color": "Color(0xb3ffffff)",
"background_color": "Color(0xff000000)"
},
},
"first": -1,
"offset": 0
}