org_file
Represents an association between an organization and a file, enabling organization-level file management and access control.
Fields
| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier for the file association |
orgId | uuid | Reference to the organization |
fileId | uuid | Reference to the file |
Relationships
Object Relationships:
org— The organization this file association belongs tofile— The associated file
Query Examples
List Organization Files
query GetOrgFiles($orgId: uuid!) {
org_file(where: { orgId: { _eq: $orgId } }) {
id
file {
name
mimeType
size
createdAt
}
org {
name
}
}
}
Mutation Examples
Create an Organization File Association
mutation CreateOrgFile {
insert_org_file_one(object: { orgId: "your-org-id", fileId: "file-id" }) {
id
file {
name
mimeType
}
}
}
Permissions
Organization file access is controlled based on organization membership:
- Member / Admin / Owner: Can view files associated with their organization, create new file associations, and delete file associations they have access to
Notes
Files can be associated with multiple organizations. Deleting an association
does not delete the actual file. File metadata and content are managed through
the file entity.