Companies

Companies Query

Returns a paginated list of Company objects, with optional filtering and ordering.

Arguments

Name
Type
Description

after

Cursor

Returns the elements in the list that come after the specified cursor

first

Int

Returns the first n elements from the list

before

Cursor

Returns the elements in the list that come before the specified cursor

last

Int

Returns the last n elements from the list

orderBy

CompanyOrder

Ordering options for companies returned from the connection

where

CompanyWhereInput

Filtering options for companies returned from the connection

Return Type

CompanyConnection! - A connection to a list of Company objects with pagination information.

Usage Example

query {
  # Search companies by name
  companies(
    where: {
      nameContains: "Tech"
    },
    orderBy: { direction: ASC, field: NAME }
  ) {
    edges {
      node {
        id
        name
        organizationID
        tenantID
        createdAt
        companyusers {
          id
          name
          email
        }
      }
      cursor
    }
    totalCount
  }
}

Common Filters

  • nameContains - Search by company name substring

  • name - Find by exact company name

  • organizationID - Filter by organization ID

  • tenantID - Filter by tenant ID

  • hasCompanyUsers - Filter companies that have users

  • hasCompanyUsersWith - Filter by user criteria

Notes

  • Companies represent organizations within the pyck system

  • Each company belongs to a tenant and organization

  • Companies can have multiple users associated with them

  • Support for multi-tenant architecture through tenantID field

  • organizationID links companies to external organization systems

Last updated

Was this helpful?