getListQuery(fields = []) { const queryContents = fields .filter(field => !List.requiredFields.includes(field.path)) .map(field => field.getQueryFragment().trim()); return gql` query getList( $where: ${this.gqlNames.whereInputName} $search: String, $sortBy: [${this.gqlNames.listSortName}!] $first: Int, $skip: Int ) { ${this.gqlNames.listQueryName}( where: $where, search: $search, sortBy: $sortBy, first: $first, skip: $skip ) { ${List.requiredFields.join('\n')} ${queryContents.join('\n')} } ${this.gqlNames.listQueryMetaName}(where: $where, search: $search) { count } } `; }
getListQuery(fields = []) { const queryContents = fields .filter(field => !List.requiredFields.includes(field.path)) .map(field => field.getQueryFragment().trim()); return gql` query getList( $where: ${this.gqlNames.whereInputName} $search: String, $sortBy: [${this.gqlNames.listSortName}!] $first: Int, $skip: Int ) { ${this.gqlNames.listQueryName}( where: $where, search: $search, sortBy: $sortBy, first: $first, skip: $skip ) { ${List.requiredFields.join('\n')} ${queryContents.join('\n')} } ${this.gqlNames.listQueryMetaName}(where: $where, search: $search) { count } } `; }