perch-query-builder
perch-query-builder copied to clipboard
Always select primary keys
Fixes #9
This PR makes it so that the primary columns are always selected. This will prevent joined relations from becoming null if no table column is selected
This PR requires additional work in order to support for example __typename. Since it is not included in the tree.fields, the join (previews below) is added, but no field is selected.
An example query would be
query {
layout(id: "db") {
previews {
__typename
}
}
}
Additional check was implemented. It will now check in the EntityMetadata if a field is a relation, instead of checking if field.fields.length > 0. This fixes __typename.