mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix deep querying in nested o2m in m2a structure
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
import { Knex } from 'knex';
|
||||
import database from '../database';
|
||||
import {
|
||||
AbstractServiceOptions,
|
||||
Accountability,
|
||||
Query,
|
||||
SchemaOverview,
|
||||
GraphQLParams,
|
||||
PrimaryKey,
|
||||
Action,
|
||||
Item,
|
||||
} from '../types';
|
||||
import { AbstractServiceOptions, Accountability, Query, SchemaOverview, GraphQLParams, Action } from '../types';
|
||||
import argon2 from 'argon2';
|
||||
import {
|
||||
GraphQLString,
|
||||
|
||||
@@ -162,10 +162,12 @@ export default async function getASTFromQuery(
|
||||
for (const relatedCollection of allowedCollections) {
|
||||
child.children[relatedCollection] = await parseFields(
|
||||
relatedCollection,
|
||||
Array.isArray(nestedFields) ? nestedFields : (nestedFields as anyNested)[relatedCollection] || ['*']
|
||||
Array.isArray(nestedFields) ? nestedFields : (nestedFields as anyNested)[relatedCollection] || ['*'],
|
||||
deep?.[`${relationalField}:${relatedCollection}`]
|
||||
);
|
||||
|
||||
child.query[relatedCollection] = {};
|
||||
child.query[relatedCollection] = getDeepQuery(deep?.[`${relationalField}:${relatedCollection}`] || {});
|
||||
|
||||
child.relatedKey[relatedCollection] = schema.collections[relatedCollection].primary;
|
||||
}
|
||||
} else if (relatedCollection) {
|
||||
|
||||
Reference in New Issue
Block a user