-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Made an Api to fetch organizations before authorization because we have to show this on Register portal in Talawa-admin #3288
Made an Api to fetch organizations before authorization because we have to show this on Register portal in Talawa-admin #3288
Conversation
Warning Rate limit exceeded@igennova has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 25 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (7)
WalkthroughThis pull request adds a new Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant G as GraphQL Server
participant R as Organizations Resolver
participant D as Database (drizzleClient)
C->>G: Send query for organizations
G->>R: Invoke organizations resolver
R->>D: Query for organizations (limit 20)
D-->>R: Return organizations data or error
alt Success
R-->>G: Return list of organizations
G-->>C: Respond with organizations array
else Error
R-->>G: Log error & throw generic error
G-->>C: Respond with error message
end
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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.
Actionable comments posted: 10
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
schema.graphql
(1 hunks)src/graphql/inputs/QueryOrganizationInput.ts
(1 hunks)src/graphql/types/Query/index.ts
(1 hunks)src/graphql/types/Query/organizations.ts
(1 hunks)test/routes/graphql/Query/organizations.test.ts
(1 hunks)test/routes/graphql/documentNodes.ts
(1 hunks)test/routes/graphql/gql.tada.d.ts
(1 hunks)
🔇 Additional comments (1)
test/routes/graphql/gql.tada.d.ts (1)
152-152
: LGTM! The type definition for the organizations query is well-structured.The
organizations
field is correctly defined as a nullable list of Organization objects, which aligns with the PR's objective of fetching organizations for display on the registration portal.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
schema.graphql
(1 hunks)src/graphql/types/Query/index.ts
(1 hunks)test/routes/graphql/documentNodes.ts
(1 hunks)test/routes/graphql/gql.tada.d.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run tests for talawa api
- GitHub Check: Analyse Code With CodeQL (typescript)
🔇 Additional comments (3)
src/graphql/types/Query/index.ts (1)
24-24
: Maintain alphabetical ordering of imports.The import for
"./organizations"
should be placed between"./organization"
and"./post"
to maintain alphabetical ordering.test/routes/graphql/documentNodes.ts (1)
519-530
: Consider adding fields useful for registration.Since this query is intended for the registration portal, consider adding fields that would help users identify and select the correct organization.
schema.graphql (1)
2890-2891
: New Organizations Query Field Added
The new query fieldorganizations: [Organization]
with its accompanying description clearly communicates its purpose for fetching organizations before registration, aligning well with the PR objectives. Please ensure that the corresponding resolver enforces the business logic (i.e. limiting the results to 20 entries) as intended.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3288 +/- ##
====================================================
+ Coverage 48.36% 48.40% +0.03%
====================================================
Files 458 459 +1
Lines 34516 34545 +29
Branches 966 971 +5
====================================================
+ Hits 16695 16720 +25
- Misses 17821 17825 +4 ☔ View full report in Codecov by Sentry. |
@coderabbit.ai full review |
@igennova I'll review the changes in detail. The changes look generally well-structured and include proper testing. Here are a few suggestions for improvement:
Let me know if you'd like me to elaborate on any of these points. |
@palisadoes Please Review this |
@disha1202 PTAL |
Hi @palisadoes , I hope you're doing well! |
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.
Please add test for the missing lines.
Rest everything looks fine.
bb75fdd
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
Issue Number:
Fixes #3244
Snapshots/Videos:

If relevant, did you update the documentation?
Summary
Changed Schema.graphql:
Updated or restructured the GraphQL schema to define the structure for the new API related to organizations.
Created organizations.ts:
Made a new file (organizations.ts) for implementing the logic and structure for the organizations-related API.
Created a New Test File for organizations.ts:
Set up a new test file for testing the functionality of the newly created organizations.ts API.
Does this PR introduce a breaking change?
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Have you read the contributing guide?
Summary by CodeRabbit