-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add organization statistics support #13
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
Add functionality to fetch organization-level statistics and metadata.
## Changes
- Add `getOrganization()` function to fetch org metadata
- Add GraphQL query for organization data
- Add comprehensive test suite
- Update README with API documentation
## API
```javascript
import { getOrganization } from 'gitevents-fetch'
const org = await getOrganization('myorg')
// Returns: { name, login, description, memberCount, publicRepoCount, ... }
```
## Features
- Organization metadata (name, description, website, location)
- Member count and public repository count
- Avatar URL and contact email
- Created/updated timestamps
- Returns null if organization not found
π€ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Pull Request Overview
This PR adds organization fetching functionality to the gitevents-fetch library, allowing users to retrieve GitHub organization statistics and metadata. The version has been bumped from 0.0.3-dev to 0.0.4 as a release version.
- Added
getOrganization()function to fetch organization data via GraphQL - Created comprehensive test coverage for the new functionality
- Updated documentation with API usage examples
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/organization.js | Implements the core organization fetching logic with parameter validation and error handling |
| src/graphql/organization.gql | Defines the GraphQL query for fetching organization data |
| src/lib/parseGql.js | Registers the new organization query |
| src/index.js | Exports the public API for getOrganization |
| test/organization.test.js | Provides comprehensive unit and integration tests |
| README.md | Documents the new organization fetching feature |
| package.json, package-lock.json | Version bump to 0.0.4 |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try { | ||
| const query = await parseGql('organization') | ||
| const vars = { | ||
| organization: org |
Copilot
AI
Oct 29, 2025
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.
Variable 'org' is used before its declaration.
- Fix variable shadowing issue in src/organization.js (renamed `org` to `orgData`) - Update getOrganization to use getGraphqlClient() pattern for consistency - Add parameter validation for getOrganization - Merge main branch changes (locations, users, files features) - Handle permission errors in organization test gracefully - All tests passing (65/65) - ESLint passing with no errors Resolves code review comment from Copilot about variable shadowing. π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
π This PR is included in version 1.3.0 π The release is available on: Your semantic-release bot π¦π |
Summary
Adds support for fetching organization-level statistics and metadata.
Closes #6
Changes
getOrganization()function to main APIAPI Usage
Features
Organization Object Structure
Test Plan
π€ Generated with Claude Code