You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
input ThingInput {
id: ID
title: String
description: String
}
type Mutation {
mergeThing(payload: ThingInput!): Thing @cypher(
statement: """
MERGE (thing:Thing $payload)
ON CREATE SET thing.id = apoc.create,uuid()
RETURN thing
"""
)
}
Haven't had a chance to verify how the composite GraphQL argument is stored/provided as a parameter to the cypher query, but it looks like you should be able to use the parameter in place of the literal map for node merging (https://neo4j.com/docs/cypher-manual/current/syntax/parameters/). This seems like it would include only the attributes that are supplied in your payload.
Hi again, is it possible to use only a subset of all of the arguments you pass into a @cypher directive mutation?
I can't seem to get this to work without putting in all of the arguments in to match the parameters in the cypher statement.
Is there a way to default values to null or something of that effect?
e.g.
type Mutation {
mergeThing(
id: ID
title: String,
description: String
): Thing
@cypher(
statement: """
MERGE (thing: Thing {title: $title, description: $description})
ON CREATE SET thing.id = apoc.create.uuid()
RETURN thing
"""
)
The text was updated successfully, but these errors were encountered: