Nested ternary operators are often not very readable. Your example is relatively easy. However, when nesting the operators differently, you have to know the execution order to properly understand it. For example (borrowed from here):
a == b ? a : b ? c : d
Is it obvious to you how this will be executed? Is it
(a == b ? a : b) ? c : d
or
a == b ? a : (b ? c : d)
? In JavaScript, the ternary operator is right associative which means it evaluates to the latter. In some programming languages, the ternary operator is not right but instead left associative. This shows that nesting ternary operators can be confusing and, thus, should either be avoided or explicitly done by adding parentheses.
If you want a oneliner to your specific question, you can use this:
var query = (type && parent && {parent:parent}) || (type && {type:type}) || {};
However, the following is much more readable in my opinion:
var query = {};
if (type) {
query = parent ? { parent: parent } : { type: type };
}