-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
Labels
Stalearea/querylang/varsIssues related to queries with GraphQL variablesIssues related to queries with GraphQL variablesarea/upsertIssues related to upsert operations.Issues related to upsert operations.kind/enhancementSomething could be better.Something could be better.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.
Description
Experience Report
What you wanted to do
I want to perform a mutation in an upsert block using user-provided data safely.
What you actually did
upsert ($name: string){
query {
var(func: eq(xid, "http://schema.org/Person")) {
Type as uid
}
var(func: eq(<http://schema.org/name>, "Robin Wright")) {
Person as uid
}
}
mutation {
set {
uid(Person) <xid> "https://www.themoviedb.org/person/32-robin-wright" .
uid(Person) <http://schema.org/type> uid(Type) .
uid(Person) <http://schema.org/name> $name .
uid(Person) <dgraph.type> "Person" .
}
}
}
Why that wasn't great, with examples
GraphQL variables are not supported in mutations, so it's impossible to safely mutate user-provided data without error-prone validation.
Any external references to support your case
None at the moment.
miko, kesor, dilipkumar2k6 and vkatushenok
Metadata
Metadata
Assignees
Labels
Stalearea/querylang/varsIssues related to queries with GraphQL variablesIssues related to queries with GraphQL variablesarea/upsertIssues related to upsert operations.Issues related to upsert operations.kind/enhancementSomething could be better.Something could be better.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.