Is it possible to "inspect" all predicates of a node without having type definitions?

No there is not - the storage is organized by predicate, not ‘node’ so the only way to see all the predicates of a node is to ask the system go to all these predicates and get the value for uid 0x123.

The type system and expand(type) is just shorthand for that format of question. Furthermore, expand(_all_) is just like expand(MyType) but looks up the type arguments for expand() from the value of dgraph.type at each node.

So as a workaround to setting types on every node, you can define a single type AllMyPredicates and use expand(AllMyPredicates) but it has the same performance implications as having every predicate there in your query.

If you use the GraphQL layer the strict typing will tell you exactly what is ‘on a node’ but behind the curtain it just knows which predicates to inspect.

1 Like