-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Revert "Revert "[4/n]: migrate the RESTAPI GET /rest/* to use TwentyORM direc…" #11349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…RM direc…" This reverts commit c6afb0d.
packages/twenty-server/test/integration/rest/suites/rest-api-core-find-many.integration-spec.ts
Fixed
Show fixed
Hide fixed
packages/twenty-server/test/integration/rest/suites/rest-api-core-find-one.integration-spec.ts
Fixed
Show fixed
Hide fixed
78936c2
to
aff7cce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR reverts recent changes to restore legacy REST API GET behavior and reverts modifications in GraphQL parsers related to feature flag support.
- packages/twenty-server/src/app.module.ts: Reintroduces RequestMethod.GET in MIGRATED_REST_METHODS for legacy GET middleware.
- packages/twenty-server/src/engine/api/graphql/.../graphql-query-order.parser.ts, graphql-query-filter-condition.parser.ts, graphql-query-filter-field.parser.ts, and graphql-query.parser.ts: Removed feature flag parameters, reverting to only fieldMetadataMapByName.
- packages/twenty-server/src/engine/api/rest/core/controllers/rest-api-core.controller.ts: Reinstates class-level exception filtering and reverts GET endpoint changes.
- Reintroduced integration tests for GET endpoints in rest-api-core-find-one.integration-spec.ts and rest-api-core-find-many.integration-spec.ts.
- packages/twenty-server/src/engine/api/rest/input-factories/order-by-input.factory.ts & rest-api.module.ts: Restores previous objectMetadata mapping and factory dependencies.
12 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-server/test/integration/rest/suites/rest-api-core-find-one.integration-spec.ts
Outdated
Show resolved
Hide resolved
closing to keep the PR history clean, let's re-open once ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
This PR reverts a previous reversion, re-implementing the REST API GET endpoints to use TwentyORM directly with improved cursor-based pagination and filtering capabilities.
- Implemented cursor-based pagination in
rest-api-core-v2.service.ts
with forward/backward navigation and metadata handling - Added comprehensive integration tests in
rest-api-core-find-many.integration-spec.ts
covering pagination, filtering, and error cases - Removed feature flag dependencies from GraphQL query parsers while maintaining core filtering/ordering functionality
- Added
FilterInputFactory
andOrderByInputFactory
to support enhanced filtering and ordering capabilities - Potential concern:
computeCursorFilter
method only uses ID for cursor filtering, which may be insufficient for complex sorting scenarios
10 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/test/integration/rest/suites/rest-api-core-find-many.integration-spec.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/test/integration/rest/suites/rest-api-core-find-many.integration-spec.ts
Outdated
Show resolved
Hide resolved
36f81ad
to
b315134
Compare
3ce148e
to
0375dfe
Compare
c7f6b3b
to
6fc27c4
Compare
0855dec
to
6a6b78d
Compare
@pacyL2K19 jeez that was hard ^^ Feel free to take a look if you want to |
Thanks for handling this from me @martmull |
...graphql-query-runner/graphql-query-parsers/graphql-query-order/graphql-query-order.parser.ts
Show resolved
Hide resolved
...er/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query.parser.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/graphql/workspace-schema.factory.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/cache-storage/services/cache-storage.service.ts
Outdated
Show resolved
Hide resolved
const ALLOWED_DEPTH_VALUES: Depth[] = [0, 1, 2]; | ||
|
||
@Injectable() | ||
export class DepthInputFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An Injectable factory seems a bit overkill to me here, why not simply a util function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be consistent with other input factories, limit is not more complex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes definitely, I didn't know limit was also a factory, I would have made a util for that one too 😛
packages/twenty-server/src/engine/api/rest/core/types/query-variables.type.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Outdated
Show resolved
Hide resolved
...er/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query.parser.ts
Outdated
Show resolved
Hide resolved
3ec6dde
to
c1bf418
Compare
7a50124
to
ef2b328
Compare
ef2b328
to
f16ccf4
Compare
...ges/twenty-server/src/engine/api/rest/core/resolvers/rest-api-update-one-resolver.service.ts
Outdated
Show resolved
Hide resolved
00e824e
to
74e1d64
Compare
## Done - add relations in dropdown variables - add relations in worklfow run inputs - use objectMetadataMaps in workflow folder ## To do - does not work with rest api calls, will be fixed after #11349 is merged - waiting for crud action relation fields twentyhq/core-team-issues#509
## Done - add relations in dropdown variables - add relations in worklfow run inputs - use objectMetadataMaps in workflow folder ## To do - does not work with rest api calls, will be fixed after #11349 is merged - waiting for crud action relation fields twentyhq/core-team-issues#509
## Done - add relations in dropdown variables - add relations in worklfow run inputs - use objectMetadataMaps in workflow folder ## To do - does not work with rest api calls, will be fixed after #11349 is merged - waiting for crud action relation fields twentyhq/core-team-issues#509
## Done - add relations in dropdown variables - add relations in worklfow run inputs - use objectMetadataMaps in workflow folder ## To do - does not work with rest api calls, will be fixed after #11349 is merged - waiting for crud action relation fields twentyhq/core-team-issues#509
## Done - add relations in dropdown variables - add relations in worklfow run inputs - use objectMetadataMaps in workflow folder ## To do - does not work with rest api calls, will be fixed after twentyhq#11349 is merged - waiting for crud action relation fields twentyhq/core-team-issues#509
Reverts #11344
Fixes twentyhq/core-team-issues#735
Depth===2 fails to depth === 1 on workspace with featureFlag
IsNewRelationEnabled = false