Ratel delete node function query seems wrong

Ratel delete node query looks like

{
	delete {
		<0x15f91> * * .
	}
}

I guess this is wrong as it is necessary to have the type schema after v1.1.0 as per delete node · Issue #4057 · dgraph-io/dgraph · GitHub

Not sure what you mean, can you detail what the issue is?

When I try to delete a node from ratel, the query that it generates doesn’t have the type schema. Thus the delete query will not be successful as type schema is required after v1.1.0

Running the delete mutation doesn’t actually delete the node.

Yeah, so you have to add the Type to it. Types aren’t done automatically. Dgraph can’t assign a type for your node.

1 - Create your Type Get started with Dgraph - It can be done in Ratel via Schema panel.

2 - Add the Type predicate. You can use the query bellow.

you have to run this in the Mutation panel.

upsert {
  query {
    v as var(func: uid(0x15f91))
  }

  mutation {
    set {
      uid(v) <dgraph.type> "myType" .
    }
  }
}

Thanks Michel. Maybe we can add an explicit prompt in the displayed query, so that users don’t get confused. Because seeing a Delete button not delete anything doesn’t seem to be right.

The generated query might look like :-
{
delete {
<0x15f91> <add_type_here> <add_value_here> .
}
}

Okay, now I get it.

I have created a issue to track this

1 Like

Thanks Michel. Really appreciate the quick response.