Graphlit Platform
Developer PortalChangelogPlatform StatusMore InformationJoin Discord
  • Graphlit Platform
    • What is Graphlit?
    • Key Concepts
  • Getting Started
    • Sign up for Graphlit
    • Create Graphlit Project
    • For Python Developers
    • For Node.js Developers
    • For .NET Developers
  • 🚀Quickstart
    • Next.js applications
      • GitHub Code
    • Python applications
      • GitHub Code
  • Graphlit Data API
    • API Usage
      • API Endpoints
      • API Authentication
      • API Explorer
      • GraphQL 101
    • API Reference
      • Content
        • Ingest With Workflow
        • Ingest File
        • Ingest Encoded File
        • Ingest Web Page
        • Ingest Text
        • Semantic Search
          • Query All Content
          • Query Facets
          • Query By Name
          • Filter By Contents
        • Metadata Filtering
          • Filter By Observations
          • Filter By Feeds
          • Filter By Collections
          • Filter By Content Type
          • Filter By File Type
          • Filter By File Size Range
          • Filter By Date Range
        • Summarize Contents
        • Extract Contents
        • Publish Contents
      • Knowledge Graph
        • Labels
        • Categories
        • Persons
        • Organizations
        • Places
        • Events
        • Products
        • Repos
        • Software
      • Collections
      • Feeds
        • Create Feed With Workflow
        • Create RSS Feed
        • Create Podcast Feed
        • Create Web Feed
        • Create Web Search Feed
        • Create Reddit Feed
        • Create Notion Feed
        • Create YouTube Feed
        • User Storage Feeds
          • Create OneDrive Feed
          • Create Google Drive Feed
          • Create SharePoint Feed
        • Cloud Storage Feeds
          • Create Amazon S3 Feed
          • Create Azure Blob Feed
          • Create Azure File Feed
          • Create Google Blob Feed
        • Messaging Feeds
          • Create Slack Feed
          • Create Microsoft Teams Feed
          • Create Discord Feed
        • Email Feeds
          • Create Google Mail Feed
          • Create Microsoft Outlook Feed
        • Issue Feeds
          • Create Linear Feed
          • Create Jira Feed
          • Create GitHub Issues Feed
        • Configuration Options
      • Workflows
        • Ingestion
        • Indexing
        • Preparation
        • Extraction
        • Enrichment
        • Actions
      • Conversations
      • Specifications
        • Azure OpenAI
        • OpenAI
        • Anthropic
        • Mistral
        • Groq
        • Deepseek
        • Replicate
        • Configuration Options
      • Alerts
        • Create Slack Audio Alert
        • Create Slack Text Alert
      • Projects
    • API Changelog
    • Multi-tenant Applications
  • JSON Mode
    • Overview
    • Document JSON
    • Transcript JSON
  • Content Types
    • Files
      • Documents
      • Audio
      • Video
      • Images
      • Animations
      • Data
      • Emails
      • Code
      • Packages
      • Other
    • Web Pages
    • Text
    • Posts
    • Messages
    • Emails
    • Issues
  • Data Sources
    • Feeds
  • Platform
    • Developer Portal
      • Projects
    • Cloud Platform
      • Security
      • Subprocessors
  • Resources
    • Community
Powered by GitBook
On this page
  • Overview
  • Operations

Was this helpful?

  1. Graphlit Data API
  2. API Reference
  3. Knowledge Graph

Categories

Create, manage and query Categories.

Overview

Categories are similar to labels, but are used for categorizing content, such as by Personally Identifiable Information (PII) category. They are unique by their name, across the Graphlit project.

Common examples of PII categories are Credit Card Number and Phone Number.

Operations

Create Category

The createCategory mutation enables the creation of a category by accepting the category name and it returns essential details, including the ID and name of the newly generated category.

Mutation:

mutation CreateCategory($category: CategoryInput!) {
  createCategory(category: $category) {
    id
    name
  }
}

Variables:

{
  "category": {
    "name": "Credit Card Number"
  }
}

Response:

{
  "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
  "name": "Credit Card Number"
}
Update Category

The updateCategory mutation enables the renaming of a category by accepting the category name.

Mutation:

mutation UpdateCategory($category: CategoryUpdateInput!) {
  updateCategory(category: $category) {
    id
    name
  }
}

Variables:

{
  "category": {
    "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
    "name": "Debit Card Number"
  }
}

Response:

{
  "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
  "name": "Debit Card Number"
}
Delete Category

The deleteCategory mutation allows the deletion of a category by utilizing the id parameter, and it returns the ID and state of the deleted category.

Mutation:

mutation DeleteCategory($id: ID!) {
  deleteCategory(id: $id) {
    id
    state
  }
}

Variables:

{
  "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc"
}

Response:

{
  "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
  "state": "DELETED"
}
Delete Categories

The deleteCategories mutation allows the deletion of multiple categories, as specified by the ids array parameter, and it returns the ID and state of the deleted categories.

Mutation:

mutation DeleteCategories($ids: [ID!]!) {
  deleteCategories(ids: $ids) {
    id
    state
  }
}

Variables:

{
  "ids": [
    "39fcf408-15ca-4cc2-9476-622d64aa38f3",
    "93476a0c-d567-4624-9d5e-df43dfff92ea"
  ]
}

Response:

[
  {
    "id": "93476a0c-d567-4624-9d5e-df43dfff92ea",
    "state": "DELETED"
  },
  {
    "id": "39fcf408-15ca-4cc2-9476-622d64aa38f3",
    "state": "DELETED"
  }
]
Get Category

The category query allows you to retrieve specific details of a category by providing the id parameter.

Query:

query GetCategory($id: ID!) {
  category(id: $id) {
    id
    name
  }
}

Variables:

{
  "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc"
}

Response:

{
  "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
  "name": "Debit Card Number"
}
Query Categories

Query Categories

The categories query allows you to retrieve all categories. It returns a list of category results, including the ID and name for each category.

Query:

query QueryCategories($filter: CategoryFilter!) {
  categories(filter: $filter) {
    results {
      id
      name
    }
  }
}

Variables:

{
  "filter": {
    "offset": 0,
    "limit": 100
  }
}

Response:

{
  "results": [
    {
      "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
      "name": "Debit Card Number"
    }
  ]
}

Query Categories By Name

The categories query allows you to retrieve categories based on a specific filter criteria, via the name parameter. In this example, the name is set to "Number." It returns a list of category results containing the ID and name for each matching category.

Query: Query:

query QueryCategories($filter: CategoryFilter!) {
  categories(filter: $filter) {
    results {
      id
      name
    }
  }
}

Variables:

{
  "filter": {
    "name": "Number",
    "offset": 0,
    "limit": 100
  }
}

Response:

{
  "results": [
    {
      "id": "2abf2bec-ca5a-44aa-81fb-431b4e4ee6fc",
      "name": "Debit Card Number"
    }
  ]
}

Last updated 1 year ago

Was this helpful?

Queries

Mutations

Objects

Query Categories
Query Categories By Name