Skip to content
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

feat(rest): Created rest package #200

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft

feat(rest): Created rest package #200

wants to merge 36 commits into from

Conversation

TriPSs
Copy link
Owner

@TriPSs TriPSs commented Nov 9, 2023

TODO

  • Support @FilterableField
  • Support None paging type
  • Documentation
  • Improve naming
  • Tests

Maybe create separate package with the shared code between rest and graphql packages (Like the interceptors)?

Copy link

nx-cloud bot commented Nov 9, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 49cd3a4. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 5 targets

Sent with 💌 from NxCloud.

@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2023

Codecov Report

Attention: 192 lines in your changes are missing coverage. Please review.

Comparison is base (c11da0c) 86.28% compared to head (5bd8ccb) 79.06%.
Report is 1 commits behind head on master.

Files Patch % Lines
...ages/query-rest/src/providers/resolver.provider.ts 48.71% 14 Missing and 6 partials ⚠️
...kages/query-rest/src/decorators/field.decorator.ts 55.55% 5 Missing and 11 partials ⚠️
...s/query-rest/src/decorators/hook-args.decorator.ts 51.72% 12 Missing and 2 partials ⚠️
...-rest/src/decorators/filterable-field.decorator.ts 56.00% 7 Missing and 4 partials ⚠️
...est/src/decorators/controller-methods.decorator.ts 75.60% 4 Missing and 6 partials ⚠️
...es/query-rest/src/interceptors/hook.interceptor.ts 41.17% 9 Missing and 1 partial ⚠️
...ges/query-rest/src/auth/default-crud.authorizer.ts 63.15% 4 Missing and 3 partials ⚠️
...es/query-rest/src/connection/offset/pager/pager.ts 75.00% 3 Missing and 4 partials ⚠️
...kages/query-rest/src/decorators/decorator.utils.ts 12.50% 5 Missing and 2 partials ⚠️
...ckages/query-rest/src/resolvers/update.resolver.ts 76.66% 5 Missing and 2 partials ⚠️
... and 31 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
- Coverage   86.28%   79.06%   -7.22%     
==========================================
  Files         688      767      +79     
  Lines        9761    10623     +862     
  Branches      862      955      +93     
==========================================
- Hits         8422     8399      -23     
- Misses        619     1401     +782     
- Partials      720      823     +103     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

nx-cloud bot commented Feb 8, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit e2353ec. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx run-many --target=e2e --all
nx run-many --target=lint --all
nx run-many --target=build --all
✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@TriPSs TriPSs marked this pull request as draft July 26, 2024 12:45
TriPSs added 11 commits August 21, 2024 17:00
…to use it

- Added `FindOneArgsType` for standardizing ID parameter handling.
- Updated delete, update, and read resolvers to use `FindOneArgsType`.
- Introduced new `id-field.decorator` for marking ID fields.
- Removed redundant `BadRequestException` in read resolver.
- Correct `FindOneArgsType` parameter in `read.resolver.ts`
- Enhance `field.decorator.ts` to properly retrieve metadata
- Add `IsNumber` and `IsString` validators for specific types
- Improve handling of array options and validation
@kasir-barati
Copy link
Contributor

@TriPSs What's going on in this PR? Kinda curious as to on what you're working in this branch. The name kinda does not ring a bell. I mean what do you mean by "rest"?

@TriPSs
Copy link
Owner Author

TriPSs commented Jan 26, 2025

@TriPSs What's going on in this PR? Kinda curious as to on what you're working in this branch. The name kinda does not ring a bell. I mean what do you mean by "rest"?

The current packages are focused on building a GraphQL API, this will add a package to create/support REST (Get, Post, Put, Delete) API (More traditional), I'm currently still building this out in inside a other project who will almost go live, so once that is done i'm back porting it here and will implement some tests so it can be released.

@kasir-barati
Copy link
Contributor

OK, so basically it will be a new package next to the others we have already. But I am worried if this will introduce extra functionality which just might complicate the source code unnecessarily. Will skim through in the next week.

@TriPSs
Copy link
Owner Author

TriPSs commented Jan 26, 2025

Well it's something I wanted/needed so i'm still going to add it, it's open for others to then also use if they don't want GraphQL.

Also since it's completely islolated in it's own package (just like GraphQL is) and uses the other services (just like the GraphQL one does) I do not see how this complicates the code base, as people only tend to look at the things they need/use (if they look at all).

@kasir-barati
Copy link
Contributor

@TriPSs OK if this has been isolated from other packages I am quite eager to see how it's been implemented. Kudos @TriPSs 💮.

@TriPSs
Copy link
Owner Author

TriPSs commented Jan 26, 2025

Well the idea is to be exactly like the GraphQL one (but with minor differences as not everything in GraphQL is available in REST), with full swagger/open api support so frontend types/libs can still be automatically generated :)

Once the internal version is live I will update this PR with the latest version, improve some naming, cleanup, add tests and merge it in for others to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants