feat: add organization statistics support#13
Merged
PatrickHeneise merged 2 commits intomainfrom Oct 29, 2025
Merged
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>
Contributor
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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