Fix includeAll for querying a Pointer and Pointer array (#7002)

* initial test

* Add failing testcase

* fix includeAll by considering array
This commit is contained in:
Corey
2020-11-11 11:57:41 -05:00
committed by GitHub
parent b4ec63e8a7
commit 568c285369
2 changed files with 88 additions and 1 deletions

View File

@@ -676,7 +676,10 @@ RestQuery.prototype.handleIncludeAll = function () {
const includeFields = [];
const keyFields = [];
for (const field in schema.fields) {
if (schema.fields[field].type && schema.fields[field].type === 'Pointer') {
if (
(schema.fields[field].type && schema.fields[field].type === 'Pointer') ||
(schema.fields[field].type && schema.fields[field].type === 'Array')
) {
includeFields.push([field]);
keyFields.push(field);
}