I want to use merge instead of create for making nodes. Since GraphQL does not make the merge statement for me, I am trying to make it myself.
This is what I am tying.
type Mutation {
MergeLesson(id: ID!, name: String!, language: String!, dialect: String , description: String):Lesson!
@cypher(
statement: "MERGE(lesson:Lesson{id: $id, name: $name, language: $language, dialect: $dialect, description: $description})"
)
}
mutation MergeLesson {
MergeLesson (id: "1", name: "test", language: "English",
dialect: "USA", description: "Testing funtion"){
name
language
dialect
description
}
}
and I Tryed
mutation MergeLesson($id: ID! $name: String!, $language: String!, $dialect: String!, $description: String!) {
MergeLesson (id: $id, name: $name, language: $language,
dialect: $dialect, description: $description){
name
language
dialect
description
}
}
I am having many problems and was wondering if there was a better way to do.
- I the ID is an issue. I have to put on in because it is required. However, I do not want to match on ID. I only want to match on name and language.
- I keep getting this error
{
"errors": [
{
"message": "Cannot return null for non-nullable field Mutation.MergeLesson.",
Should I keep trying to get it to work this way or try something else?