-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[4/n]: migrate the RESTAPI GET /rest/* to use TwentyORM directly #10372
base: main
Are you sure you want to change the base?
Conversation
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 migrates the GET endpoint in the REST API to use TwentyORM directly instead of going through GraphQL, improving performance by removing the intermediate GraphQL layer.
- Added new
RestApiCoreServiceV2
in/packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
to handle direct TwentyORM operations - Implemented filter processing system in
getWhereFilter
method but currently commented out in the GET implementation - Added
FilterInputFactory
toRestApiModule
for handling query filter parameters - Switched GET endpoint in
RestApiCoreController
to userestApiCoreServiceV2.get()
withRestApiExceptionFilter
- Commented out
RequestMethod.GET
fromMIGRATED_REST_METHODS
inapp.module.ts
to indicate work in progress
6 file(s) reviewed, 3 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
61edae6
to
c573de8
Compare
319ee5e
to
e1ac8a3
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.
@martmull I think this PR is ready for a review
ec2ee2e
to
b084cab
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.
Hey, that's very nice code, concise and clear. I have left 2 some comments
Also, I see that depth
query parameter is not taken into account in v2. @Weiko do you have an idea of how we can we do that with the twenty-orm ?
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/api/rest/core/rest-api-core-v2.service.ts
Show resolved
Hide resolved
b084cab
to
cf31305
Compare
Thank you for the review @martmull |
In graphql we use ProcessNestedRelations, we will probably something similar here |
Thanks for the hint @Weiko |
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.
LGTM, I still don't see where featureFlagsMap
is useful here but it is not that important
Nice work thank you!
...y-runner/graphql-query-parsers/graphql-query-filter/graphql-query-filter-condition.parser.ts
Outdated
Show resolved
Hide resolved
...y-runner/graphql-query-parsers/graphql-query-filter/graphql-query-filter-condition.parser.ts
Outdated
Show resolved
Hide resolved
3ff5102
to
856e19f
Compare
e2e00a8
to
b1b50eb
Compare
5daddfc
to
a126ff6
Compare
a126ff6
to
1af0c15
Compare
Hey @martmull and @pacyL2K19, should this be merged ? Remark: |
Hi @prastoin About the depreciation of OrderByCondition, yes, I saw that, may be worth an entire ticket, jic |
Hi @pacyL2K19, obviously take your time no hurry ! Was just doing a tour on opened PRs
Ok ! sounds good |
This PR
findOne
and thefindMany
Rest API to use TwentyORM directly