remove nestjs-query auto-resolver from index-metadata (#22775)

## Summary

Removes the `NestjsQueryGraphQLModule.forFeature` block from
`IndexMetadataModule`, continuing the incremental migration off
`@ptc-org/nestjs-query`.

- Drops the dead auto-generated read surface: `index` and
`indexMetadatas` queries, the `IndexConnection` /
`IndexObjectMetadataConnection` types, and the `Index.objectMetadata`
field. No client consumes these — the frontend reads indexes via
`ObjectMetadata.indexMetadatas`.
- Keeps `IndexMetadataDTO` nestjs-query-compatible (`@Authorize`,
`@FilterableField`, `@QueryOptions`, `@IDField`) because
`ObjectMetadataDTO` still references it via
`@CursorConnection('indexMetadatas')` until object-metadata is migrated.
- Hand-written `createOneIndex` / `deleteOneIndex` mutations and the
`indexFieldMetadataList` resolve-field are unchanged.
- Deletes the now-obsolete `index-metadatas` integration test and
regenerates the GraphQL schema artifacts (frontend + client-sdk).

## Breaking change

This is an intentional GraphQL schema breaking change
(`api-breaking-changes` CI will flag it)

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22775?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Abdul Rahman
2026-07-10 17:30:23 +05:30
committed by GitHub
parent 04c195a54e
commit ffdda50afc
7 changed files with 1174 additions and 1462 deletions
@@ -535,13 +535,6 @@ type Index {
createdAt: DateTime!
updatedAt: DateTime!
indexFieldMetadataList: [IndexField!]!
objectMetadata(
"""Limit or page results."""
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: ObjectFilter! = {}
): IndexObjectMetadataConnection!
}
"""Type of the index"""
@@ -550,58 +543,6 @@ enum IndexType {
GIN
}
input CursorPaging {
"""Paginate before opaque cursor"""
before: ConnectionCursor
"""Paginate after opaque cursor"""
after: ConnectionCursor
"""Paginate first"""
first: Int
"""Paginate last"""
last: Int
}
"""Cursor for paging through collections"""
scalar ConnectionCursor
input ObjectFilter {
and: [ObjectFilter!]
or: [ObjectFilter!]
id: UUIDFilterComparison
isRemote: BooleanFieldComparison
isActive: BooleanFieldComparison
isSystem: BooleanFieldComparison
isUIEditable: BooleanFieldComparison
isUICreatable: BooleanFieldComparison
isUIReadOnly: BooleanFieldComparison
isSearchable: BooleanFieldComparison
}
input UUIDFilterComparison {
is: Boolean
isNot: Boolean
eq: UUID
neq: UUID
gt: UUID
gte: UUID
lt: UUID
lte: UUID
like: UUID
notLike: UUID
iLike: UUID
notILike: UUID
in: [UUID!]
notIn: [UUID!]
}
input BooleanFieldComparison {
is: Boolean
isNot: Boolean
}
type Object {
id: UUID!
universalIdentifier: String!
@@ -646,6 +587,23 @@ type Object {
): ObjectIndexMetadatasConnection!
}
input CursorPaging {
"""Paginate before opaque cursor"""
before: ConnectionCursor
"""Paginate after opaque cursor"""
after: ConnectionCursor
"""Paginate first"""
first: Int
"""Paginate last"""
last: Int
}
"""Cursor for paging through collections"""
scalar ConnectionCursor
input FieldFilter {
and: [FieldFilter!]
or: [FieldFilter!]
@@ -657,6 +615,28 @@ input FieldFilter {
objectMetadataId: UUIDFilterComparison
}
input UUIDFilterComparison {
is: Boolean
isNot: Boolean
eq: UUID
neq: UUID
gt: UUID
gte: UUID
lt: UUID
lte: UUID
like: UUID
notLike: UUID
iLike: UUID
notILike: UUID
in: [UUID!]
notIn: [UUID!]
}
input BooleanFieldComparison {
is: Boolean
isNot: Boolean
}
input IndexFilter {
and: [IndexFilter!]
or: [IndexFilter!]
@@ -2001,9 +1981,23 @@ type IndexField {
updatedAt: DateTime!
}
type IndexEdge {
"""The node containing the Index"""
node: Index!
type ObjectRecordCount {
objectNamePlural: String!
totalCount: Int!
}
type SearchField {
id: UUID!
fieldMetadataId: UUID!
tsVectorFieldMetadataId: UUID!
position: Float!
createdAt: DateTime!
updatedAt: DateTime!
}
type ObjectEdge {
"""The node containing the Object"""
node: Object!
"""Cursor for this node."""
cursor: ConnectionCursor!
@@ -2023,44 +2017,6 @@ type PageInfo {
endCursor: ConnectionCursor
}
type IndexConnection {
"""Paging information"""
pageInfo: PageInfo!
"""Array of edges."""
edges: [IndexEdge!]!
}
type ObjectEdge {
"""The node containing the Object"""
node: Object!
"""Cursor for this node."""
cursor: ConnectionCursor!
}
type IndexObjectMetadataConnection {
"""Paging information"""
pageInfo: PageInfo!
"""Array of edges."""
edges: [ObjectEdge!]!
}
type ObjectRecordCount {
objectNamePlural: String!
totalCount: Int!
}
type SearchField {
id: UUID!
fieldMetadataId: UUID!
tsVectorFieldMetadataId: UUID!
position: Float!
createdAt: DateTime!
updatedAt: DateTime!
}
type ObjectConnection {
"""Paging information"""
pageInfo: PageInfo!
@@ -2069,6 +2025,14 @@ type ObjectConnection {
edges: [ObjectEdge!]!
}
type IndexEdge {
"""The node containing the Index"""
node: Index!
"""Cursor for this node."""
cursor: ConnectionCursor!
}
type ObjectIndexMetadatasConnection {
"""Paging information"""
pageInfo: PageInfo!
@@ -3107,17 +3071,6 @@ type Query {
"""Specify to filter the records returned."""
filter: ObjectFilter! = {}
): ObjectConnection!
index(
"""The id of the record to find."""
id: UUID!
): Index!
indexMetadatas(
"""Limit or page results."""
paging: CursorPaging! = {first: 10}
"""Specify to filter the records returned."""
filter: IndexFilter! = {}
): IndexConnection!
findOneLogicFunction(input: LogicFunctionIdInput!): LogicFunction!
findManyLogicFunctions: [LogicFunction!]!
getAvailablePackages(input: LogicFunctionIdInput!): JSON!
@@ -3208,6 +3161,19 @@ input AgentIdInput {
id: UUID!
}
input ObjectFilter {
and: [ObjectFilter!]
or: [ObjectFilter!]
id: UUIDFilterComparison
isRemote: BooleanFieldComparison
isActive: BooleanFieldComparison
isSystem: BooleanFieldComparison
isUIEditable: BooleanFieldComparison
isUICreatable: BooleanFieldComparison
isUIReadOnly: BooleanFieldComparison
isSearchable: BooleanFieldComparison
}
input LogicFunctionIdInput {
"""The id of the function."""
id: ID!
@@ -392,7 +392,6 @@ export interface Index {
createdAt: Scalars['DateTime']
updatedAt: Scalars['DateTime']
indexFieldMetadataList: IndexField[]
objectMetadata: IndexObjectMetadataConnection
__typename: 'Index'
}
@@ -1644,50 +1643,6 @@ export interface IndexField {
__typename: 'IndexField'
}
export interface IndexEdge {
/** The node containing the Index */
node: Index
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor']
__typename: 'IndexEdge'
}
export interface PageInfo {
/** true if paging forward and there are more records. */
hasNextPage?: Scalars['Boolean']
/** true if paging backwards and there are more records. */
hasPreviousPage?: Scalars['Boolean']
/** The cursor of the first returned record. */
startCursor?: Scalars['ConnectionCursor']
/** The cursor of the last returned record. */
endCursor?: Scalars['ConnectionCursor']
__typename: 'PageInfo'
}
export interface IndexConnection {
/** Paging information */
pageInfo: PageInfo
/** Array of edges. */
edges: IndexEdge[]
__typename: 'IndexConnection'
}
export interface ObjectEdge {
/** The node containing the Object */
node: Object
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor']
__typename: 'ObjectEdge'
}
export interface IndexObjectMetadataConnection {
/** Paging information */
pageInfo: PageInfo
/** Array of edges. */
edges: ObjectEdge[]
__typename: 'IndexObjectMetadataConnection'
}
export interface ObjectRecordCount {
objectNamePlural: Scalars['String']
totalCount: Scalars['Int']
@@ -1704,6 +1659,26 @@ export interface SearchField {
__typename: 'SearchField'
}
export interface ObjectEdge {
/** The node containing the Object */
node: Object
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor']
__typename: 'ObjectEdge'
}
export interface PageInfo {
/** true if paging forward and there are more records. */
hasNextPage?: Scalars['Boolean']
/** true if paging backwards and there are more records. */
hasPreviousPage?: Scalars['Boolean']
/** The cursor of the first returned record. */
startCursor?: Scalars['ConnectionCursor']
/** The cursor of the last returned record. */
endCursor?: Scalars['ConnectionCursor']
__typename: 'PageInfo'
}
export interface ObjectConnection {
/** Paging information */
pageInfo: PageInfo
@@ -1712,6 +1687,14 @@ export interface ObjectConnection {
__typename: 'ObjectConnection'
}
export interface IndexEdge {
/** The node containing the Index */
node: Index
/** Cursor for this node. */
cursor: Scalars['ConnectionCursor']
__typename: 'IndexEdge'
}
export interface ObjectIndexMetadatasConnection {
/** Paging information */
pageInfo: PageInfo
@@ -2739,8 +2722,6 @@ export interface Query {
objectRecordCounts: ObjectRecordCount[]
object: Object
objects: ObjectConnection
index: Index
indexMetadatas: IndexConnection
findOneLogicFunction: LogicFunction
findManyLogicFunctions: LogicFunction[]
getAvailablePackages: Scalars['JSON']
@@ -3447,31 +3428,10 @@ export interface IndexGenqlSelection{
createdAt?: boolean | number
updatedAt?: boolean | number
indexFieldMetadataList?: IndexFieldGenqlSelection
objectMetadata?: (IndexObjectMetadataConnectionGenqlSelection & { __args: {
/** Limit or page results. */
paging: CursorPaging,
/** Specify to filter the records returned. */
filter: ObjectFilter} })
__typename?: boolean | number
__scalar?: boolean | number
}
export interface CursorPaging {
/** Paginate before opaque cursor */
before?: (Scalars['ConnectionCursor'] | null),
/** Paginate after opaque cursor */
after?: (Scalars['ConnectionCursor'] | null),
/** Paginate first */
first?: (Scalars['Int'] | null),
/** Paginate last */
last?: (Scalars['Int'] | null)}
export interface ObjectFilter {and?: (ObjectFilter[] | null),or?: (ObjectFilter[] | null),id?: (UUIDFilterComparison | null),isRemote?: (BooleanFieldComparison | null),isActive?: (BooleanFieldComparison | null),isSystem?: (BooleanFieldComparison | null),isUIEditable?: (BooleanFieldComparison | null),isUICreatable?: (BooleanFieldComparison | null),isUIReadOnly?: (BooleanFieldComparison | null),isSearchable?: (BooleanFieldComparison | null)}
export interface UUIDFilterComparison {is?: (Scalars['Boolean'] | null),isNot?: (Scalars['Boolean'] | null),eq?: (Scalars['UUID'] | null),neq?: (Scalars['UUID'] | null),gt?: (Scalars['UUID'] | null),gte?: (Scalars['UUID'] | null),lt?: (Scalars['UUID'] | null),lte?: (Scalars['UUID'] | null),like?: (Scalars['UUID'] | null),notLike?: (Scalars['UUID'] | null),iLike?: (Scalars['UUID'] | null),notILike?: (Scalars['UUID'] | null),in?: (Scalars['UUID'][] | null),notIn?: (Scalars['UUID'][] | null)}
export interface BooleanFieldComparison {is?: (Scalars['Boolean'] | null),isNot?: (Scalars['Boolean'] | null)}
export interface ObjectGenqlSelection{
id?: boolean | number
universalIdentifier?: boolean | number
@@ -3515,8 +3475,22 @@ export interface ObjectGenqlSelection{
__scalar?: boolean | number
}
export interface CursorPaging {
/** Paginate before opaque cursor */
before?: (Scalars['ConnectionCursor'] | null),
/** Paginate after opaque cursor */
after?: (Scalars['ConnectionCursor'] | null),
/** Paginate first */
first?: (Scalars['Int'] | null),
/** Paginate last */
last?: (Scalars['Int'] | null)}
export interface FieldFilter {and?: (FieldFilter[] | null),or?: (FieldFilter[] | null),id?: (UUIDFilterComparison | null),isActive?: (BooleanFieldComparison | null),isSystem?: (BooleanFieldComparison | null),isUIEditable?: (BooleanFieldComparison | null),isUIReadOnly?: (BooleanFieldComparison | null),objectMetadataId?: (UUIDFilterComparison | null)}
export interface UUIDFilterComparison {is?: (Scalars['Boolean'] | null),isNot?: (Scalars['Boolean'] | null),eq?: (Scalars['UUID'] | null),neq?: (Scalars['UUID'] | null),gt?: (Scalars['UUID'] | null),gte?: (Scalars['UUID'] | null),lt?: (Scalars['UUID'] | null),lte?: (Scalars['UUID'] | null),like?: (Scalars['UUID'] | null),notLike?: (Scalars['UUID'] | null),iLike?: (Scalars['UUID'] | null),notILike?: (Scalars['UUID'] | null),in?: (Scalars['UUID'][] | null),notIn?: (Scalars['UUID'][] | null)}
export interface BooleanFieldComparison {is?: (Scalars['Boolean'] | null),isNot?: (Scalars['Boolean'] | null)}
export interface IndexFilter {and?: (IndexFilter[] | null),or?: (IndexFilter[] | null),id?: (UUIDFilterComparison | null),isCustom?: (BooleanFieldComparison | null)}
export interface ApplicationGenqlSelection{
@@ -4758,9 +4732,27 @@ export interface IndexFieldGenqlSelection{
__scalar?: boolean | number
}
export interface IndexEdgeGenqlSelection{
/** The node containing the Index */
node?: IndexGenqlSelection
export interface ObjectRecordCountGenqlSelection{
objectNamePlural?: boolean | number
totalCount?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
export interface SearchFieldGenqlSelection{
id?: boolean | number
fieldMetadataId?: boolean | number
tsVectorFieldMetadataId?: boolean | number
position?: boolean | number
createdAt?: boolean | number
updatedAt?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
export interface ObjectEdgeGenqlSelection{
/** The node containing the Object */
node?: ObjectGenqlSelection
/** Cursor for this node. */
cursor?: boolean | number
__typename?: boolean | number
@@ -4780,51 +4772,6 @@ export interface PageInfoGenqlSelection{
__scalar?: boolean | number
}
export interface IndexConnectionGenqlSelection{
/** Paging information */
pageInfo?: PageInfoGenqlSelection
/** Array of edges. */
edges?: IndexEdgeGenqlSelection
__typename?: boolean | number
__scalar?: boolean | number
}
export interface ObjectEdgeGenqlSelection{
/** The node containing the Object */
node?: ObjectGenqlSelection
/** Cursor for this node. */
cursor?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
export interface IndexObjectMetadataConnectionGenqlSelection{
/** Paging information */
pageInfo?: PageInfoGenqlSelection
/** Array of edges. */
edges?: ObjectEdgeGenqlSelection
__typename?: boolean | number
__scalar?: boolean | number
}
export interface ObjectRecordCountGenqlSelection{
objectNamePlural?: boolean | number
totalCount?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
export interface SearchFieldGenqlSelection{
id?: boolean | number
fieldMetadataId?: boolean | number
tsVectorFieldMetadataId?: boolean | number
position?: boolean | number
createdAt?: boolean | number
updatedAt?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
export interface ObjectConnectionGenqlSelection{
/** Paging information */
pageInfo?: PageInfoGenqlSelection
@@ -4834,6 +4781,15 @@ export interface ObjectConnectionGenqlSelection{
__scalar?: boolean | number
}
export interface IndexEdgeGenqlSelection{
/** The node containing the Index */
node?: IndexGenqlSelection
/** Cursor for this node. */
cursor?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
export interface ObjectIndexMetadatasConnectionGenqlSelection{
/** Paging information */
pageInfo?: PageInfoGenqlSelection
@@ -5943,14 +5899,6 @@ export interface QueryGenqlSelection{
paging: CursorPaging,
/** Specify to filter the records returned. */
filter: ObjectFilter} })
index?: (IndexGenqlSelection & { __args: {
/** The id of the record to find. */
id: Scalars['UUID']} })
indexMetadatas?: (IndexConnectionGenqlSelection & { __args: {
/** Limit or page results. */
paging: CursorPaging,
/** Specify to filter the records returned. */
filter: IndexFilter} })
findOneLogicFunction?: (LogicFunctionGenqlSelection & { __args: {input: LogicFunctionIdInput} })
findManyLogicFunctions?: LogicFunctionGenqlSelection
getAvailablePackages?: { __args: {input: LogicFunctionIdInput} }
@@ -6037,6 +5985,8 @@ export interface AgentIdInput {
/** The id of the agent. */
id: Scalars['UUID']}
export interface ObjectFilter {and?: (ObjectFilter[] | null),or?: (ObjectFilter[] | null),id?: (UUIDFilterComparison | null),isRemote?: (BooleanFieldComparison | null),isActive?: (BooleanFieldComparison | null),isSystem?: (BooleanFieldComparison | null),isUIEditable?: (BooleanFieldComparison | null),isUICreatable?: (BooleanFieldComparison | null),isUIReadOnly?: (BooleanFieldComparison | null),isSearchable?: (BooleanFieldComparison | null)}
export interface LogicFunctionIdInput {
/** The id of the function. */
id: Scalars['ID']}
@@ -7776,46 +7726,6 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
const IndexEdge_possibleTypes: string[] = ['IndexEdge']
export const isIndexEdge = (obj?: { __typename?: any } | null): obj is IndexEdge => {
if (!obj?.__typename) throw new Error('__typename is missing in "isIndexEdge"')
return IndexEdge_possibleTypes.includes(obj.__typename)
}
const PageInfo_possibleTypes: string[] = ['PageInfo']
export const isPageInfo = (obj?: { __typename?: any } | null): obj is PageInfo => {
if (!obj?.__typename) throw new Error('__typename is missing in "isPageInfo"')
return PageInfo_possibleTypes.includes(obj.__typename)
}
const IndexConnection_possibleTypes: string[] = ['IndexConnection']
export const isIndexConnection = (obj?: { __typename?: any } | null): obj is IndexConnection => {
if (!obj?.__typename) throw new Error('__typename is missing in "isIndexConnection"')
return IndexConnection_possibleTypes.includes(obj.__typename)
}
const ObjectEdge_possibleTypes: string[] = ['ObjectEdge']
export const isObjectEdge = (obj?: { __typename?: any } | null): obj is ObjectEdge => {
if (!obj?.__typename) throw new Error('__typename is missing in "isObjectEdge"')
return ObjectEdge_possibleTypes.includes(obj.__typename)
}
const IndexObjectMetadataConnection_possibleTypes: string[] = ['IndexObjectMetadataConnection']
export const isIndexObjectMetadataConnection = (obj?: { __typename?: any } | null): obj is IndexObjectMetadataConnection => {
if (!obj?.__typename) throw new Error('__typename is missing in "isIndexObjectMetadataConnection"')
return IndexObjectMetadataConnection_possibleTypes.includes(obj.__typename)
}
const ObjectRecordCount_possibleTypes: string[] = ['ObjectRecordCount']
export const isObjectRecordCount = (obj?: { __typename?: any } | null): obj is ObjectRecordCount => {
if (!obj?.__typename) throw new Error('__typename is missing in "isObjectRecordCount"')
@@ -7832,6 +7742,22 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
const ObjectEdge_possibleTypes: string[] = ['ObjectEdge']
export const isObjectEdge = (obj?: { __typename?: any } | null): obj is ObjectEdge => {
if (!obj?.__typename) throw new Error('__typename is missing in "isObjectEdge"')
return ObjectEdge_possibleTypes.includes(obj.__typename)
}
const PageInfo_possibleTypes: string[] = ['PageInfo']
export const isPageInfo = (obj?: { __typename?: any } | null): obj is PageInfo => {
if (!obj?.__typename) throw new Error('__typename is missing in "isPageInfo"')
return PageInfo_possibleTypes.includes(obj.__typename)
}
const ObjectConnection_possibleTypes: string[] = ['ObjectConnection']
export const isObjectConnection = (obj?: { __typename?: any } | null): obj is ObjectConnection => {
if (!obj?.__typename) throw new Error('__typename is missing in "isObjectConnection"')
@@ -7840,6 +7766,14 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
const IndexEdge_possibleTypes: string[] = ['IndexEdge']
export const isIndexEdge = (obj?: { __typename?: any } | null): obj is IndexEdge => {
if (!obj?.__typename) throw new Error('__typename is missing in "isIndexEdge"')
return IndexEdge_possibleTypes.includes(obj.__typename)
}
const ObjectIndexMetadatasConnection_possibleTypes: string[] = ['ObjectIndexMetadatasConnection']
export const isObjectIndexMetadatasConnection = (obj?: { __typename?: any } | null): obj is ObjectIndexMetadatasConnection => {
if (!obj?.__typename) throw new Error('__typename is missing in "isObjectIndexMetadatasConnection"')
File diff suppressed because it is too large Load Diff
@@ -2061,24 +2061,9 @@ export type Index = {
isCustom?: Maybe<Scalars['Boolean']['output']>;
isUnique: Scalars['Boolean']['output'];
name: Scalars['String']['output'];
objectMetadata: IndexObjectMetadataConnection;
updatedAt: Scalars['DateTime']['output'];
};
export type IndexObjectMetadataArgs = {
filter?: ObjectFilter;
paging?: CursorPaging;
};
export type IndexConnection = {
__typename?: 'IndexConnection';
/** Array of edges. */
edges: Array<IndexEdge>;
/** Paging information */
pageInfo: PageInfo;
};
export type IndexEdge = {
__typename?: 'IndexEdge';
/** Cursor for this node. */
@@ -2104,14 +2089,6 @@ export type IndexFilter = {
or?: InputMaybe<Array<IndexFilter>>;
};
export type IndexObjectMetadataConnection = {
__typename?: 'IndexObjectMetadataConnection';
/** Array of edges. */
edges: Array<ObjectEdge>;
/** Paging information */
pageInfo: PageInfo;
};
/** Type of the index */
export enum IndexType {
BTREE = 'BTREE',
@@ -4420,8 +4397,6 @@ export type Query = {
getViewSorts: Array<ViewSort>;
getViews: Array<View>;
getWorkspaceCreationDefaults: WorkspaceCreationDefaultsDto;
index: Index;
indexMetadatas: IndexConnection;
lineChartData: LineChartData;
listPlans: Array<BillingPlan>;
minimalMetadata: MinimalMetadata;
@@ -4763,17 +4738,6 @@ export type QueryGetViewsArgs = {
};
export type QueryIndexArgs = {
id: Scalars['UUID']['input'];
};
export type QueryIndexMetadatasArgs = {
filter?: IndexFilter;
paging?: CursorPaging;
};
export type QueryLineChartDataArgs = {
input: LineChartDataInput;
};
@@ -7,7 +7,6 @@ import {
import {
Authorize,
CursorConnection,
FilterableField,
IDField,
QueryOptions,
@@ -25,13 +24,14 @@ import {
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { IsValidMetadataName } from 'src/engine/decorators/metadata/is-valid-metadata-name.decorator';
import { IndexType } from 'src/engine/metadata-modules/index-metadata/types/indexType.types';
import { ObjectMetadataDTO } from 'src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto';
registerEnumType(IndexType, {
name: 'IndexType',
description: 'Type of the index',
});
// TODO: drop these nestjs-query decorators once ObjectMetadataDTO's
// @CursorConnection('indexMetadatas') relation is migrated off nestjs-query.
@ObjectType('Index')
@Authorize({
// oxlint-disable-next-line typescript/no-explicit-any
@@ -44,7 +44,6 @@ registerEnumType(IndexType, {
disableSort: true,
maxResultsSize: 1000,
})
@CursorConnection('objectMetadata', () => ObjectMetadataDTO)
export class IndexMetadataDTO {
@IsUUID()
@IsNotEmpty()
@@ -1,19 +1,11 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { SortDirection } from '@ptc-org/nestjs-query-core';
import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
import { WorkspaceManyOrAllFlatEntityMapsCacheModule } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.module';
import { IndexMetadataDTO } from 'src/engine/metadata-modules/index-metadata/dtos/index-metadata.dto';
import { IndexFieldMetadataEntity } from 'src/engine/metadata-modules/index-metadata/index-field-metadata.entity';
import { IndexMetadataEntity } from 'src/engine/metadata-modules/index-metadata/index-metadata.entity';
import { IndexMetadataResolver } from 'src/engine/metadata-modules/index-metadata/index-metadata.resolver';
import { IndexMetadataService } from 'src/engine/metadata-modules/index-metadata/services/index-metadata.service';
import { ObjectMetadataGraphqlApiExceptionInterceptor } from 'src/engine/metadata-modules/object-metadata/interceptors/object-metadata-graphql-api-exception.interceptor';
import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permissions.module';
import { WorkspaceMigrationModule } from 'src/engine/workspace-manager/workspace-migration/workspace-migration.module';
@@ -24,33 +16,6 @@ import { WorkspaceMigrationModule } from 'src/engine/workspace-manager/workspace
PermissionsModule,
WorkspaceMigrationModule,
WorkspaceManyOrAllFlatEntityMapsCacheModule,
NestjsQueryGraphQLModule.forFeature({
imports: [
NestjsQueryTypeOrmModule.forFeature([
IndexMetadataEntity,
IndexFieldMetadataEntity,
]),
],
resolvers: [
{
EntityClass: IndexMetadataEntity,
DTOClass: IndexMetadataDTO,
read: {
defaultSort: [{ field: 'id', direction: SortDirection.DESC }],
many: {
name: 'indexMetadatas', //TODO: check + singular
},
},
create: {
disabled: true,
},
update: { disabled: true },
delete: { disabled: true },
guards: [WorkspaceAuthGuard],
interceptors: [ObjectMetadataGraphqlApiExceptionInterceptor],
},
],
}),
],
providers: [IndexMetadataResolver, IndexMetadataService],
exports: [IndexMetadataService],
@@ -1,59 +0,0 @@
import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('indexMetadatasResolver (e2e)', () => {
it('should find many indexMetadatas', () => {
const queryData = {
query: `
query indexMetadatas {
indexMetadatas {
edges {
node {
id
name
isCustom
isUnique
indexWhereClause
indexType
createdAt
updatedAt
}
}
}
}
`,
};
return client
.post('/metadata')
.set('Authorization', `Bearer ${APPLE_JANE_ADMIN_ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.indexMetadatas;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const indexMetadatas = edges[0].node;
expect(indexMetadatas).toHaveProperty('id');
expect(indexMetadatas).toHaveProperty('name');
expect(indexMetadatas).toHaveProperty('isCustom');
expect(indexMetadatas).toHaveProperty('isUnique');
expect(indexMetadatas).toHaveProperty('indexWhereClause');
expect(indexMetadatas).toHaveProperty('indexType');
expect(indexMetadatas).toHaveProperty('createdAt');
expect(indexMetadatas).toHaveProperty('updatedAt');
}
});
});
});