> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/inputs.md).

# Inputs

GraphQL Input Type Definitions

This section documents the input types used in the pyck GraphQL API. Input types are used as arguments for mutations and query parameters, providing structured data for creating, updating, and filtering entities.

## Overview

Input types in pyck follow consistent naming patterns:

* **Create Inputs**: `Create<Type>Input` - Used for creating new entities
* **Update Inputs**: `Update<Type>Input` - Used for updating existing entities
* **Where Inputs**: `<Type>WhereInput` - Used for filtering entities in queries
* **OrderBy Inputs**: `<Type>OrderByInput` - Used for sorting entities in queries

## Available Input Types

### WhereInput Types

WhereInput types provide comprehensive filtering capabilities for queries. They include logical operators, field comparisons, relationship filtering, and data field operations.

* [**WhereInput Types Overview**](/graphql-api/inputs/where-inputs.md) - Comprehensive guide to filtering with WhereInput types
* [**InventoryItemWhereInput**](/graphql-api/inputs/inventoryitemwhereinput.md) - Detailed documentation for inventory item filtering

For a complete list of all available WhereInput types, see the [WhereInput Types Overview](/graphql-api/inputs/where-inputs.md).

### Event Input Types

Input types for custom event operations:

* [**CustomEventPayloadInput**](/graphql-api/inputs/customeventpayloadinput.md) - Structured payload for custom events with entity ID and optional data

### Workflow Input Types

Input types for workflow-related operations:

* [**GetAssigneeInput**](/graphql-api/inputs/getassigneeinput.md) - Query the current assignee of a workflow
* [**SetAssigneeInput**](/graphql-api/inputs/setassigneeinput.md) - Set or update the assignee of a workflow
* [**GetWorkflowActionsInput**](/graphql-api/inputs/getworkflowactionsinput.md) - Identify the workflow execution whose available actions should be retrieved
* [**WorkflowActionsWhereInput**](/graphql-api/inputs/workflowactionswhereinput.md) - Optional filter for the `workflowActions` query
* [**GetWorkflowTargetsInput**](/graphql-api/inputs/getworkflowtargetsinput.md) - Identify the workflow execution whose target surfaces should be retrieved
* [**SetWorkflowTargetsInput**](/graphql-api/inputs/setworkflowtargetsinput.md) - Replace the target surfaces of a running workflow execution

### Create Input Types

Create input types define the required and optional fields when creating new entities. They typically include:

* Required fields that must be provided
* Optional fields with default values
* Relationship references (IDs of related entities)
* Data field for custom JSON attributes

### Update Input Types

Update input types allow partial updates to existing entities. They typically include:

* Entity ID (required)
* Optional fields that can be updated
* Relationship updates
* Data field modifications

### OrderBy Input Types

OrderBy input types provide sorting capabilities for query results. They typically include:

* Field-based sorting (ASC/DESC)
* Multiple field sorting with priority
* Relationship-based sorting

## Common Patterns

### Field Predicates

WhereInput types use consistent field predicate patterns:

```graphql
# Basic comparisons
field: Value                    # Equal to
fieldNEQ: Value                # Not equal to
fieldIn: [Value!]              # In list
fieldNotIn: [Value!]           # Not in list

# Ordering comparisons
fieldGT: Value                 # Greater than
fieldGTE: Value               # Greater than or equal
fieldLT: Value                # Less than
fieldLTE: Value               # Less than or equal

# String operations
fieldContains: String         # Contains substring
fieldHasPrefix: String        # Starts with
fieldHasSuffix: String        # Ends with
fieldEqualFold: String        # Case-insensitive equal
fieldContainsFold: String     # Case-insensitive contains

# Null checks
fieldIsNil: Boolean           # Is null
fieldNotNil: Boolean          # Is not null
```

### Logical Operators

All WhereInput types support logical operations:

```graphql
{
  not: WhereInput              # Negation
  and: [WhereInput!]          # All conditions must match
  or: [WhereInput!]           # At least one condition must match
}
```

### Relationship Filtering

Entities with relationships provide filtering on related entities:

```graphql
{
  hasRelationship: Boolean                    # Has related entities
  hasRelationshipWith: [RelatedWhereInput!]  # Filter by related entity properties
}
```

### Data Field Operations

For entities with JSON data fields, pyck provides powerful query operations:

```graphql
{
  Data: [String!]             # Match exact value at JSON path
  DataHasKey: String          # Check if key exists at path
  DataIn: [String!]           # Value at path is in list
  DataContains: [String!]     # String at path contains substring
}
```

For detailed information on JSON field queries, including path syntax and advanced examples, see the [Advanced JSON Field Queries](https://github.com/pyck-ai/docs/blob/main/graphql/advanced/json-field-queries.md) guide.

## Usage Examples

### Basic Filtering

```graphql
query {
  inventoryItems(
    where: {
      sku: "PHONE-001"
    }
  ) {
    edges {
      node {
        id
        sku
      }
    }
  }
}
```

### Complex Filtering

```graphql
query {
  inventoryItems(
    where: {
      and: [
        { skuContainsFold: "phone" },
        { createdAtGTE: "2023-01-01T00:00:00Z" },
        {
          hasItemstockWith: [
            { quantityGT: 0 }
          ]
        }
      ]
    }
  ) {
    edges {
      node {
        id
        sku
        createdAt
      }
    }
  }
}
```

### Creating Entities

```graphql
mutation {
  createInventoryItem(
    input: {
      sku: "PHONE-001"
      dataTypeSlug: "product"
      data: {
        name: "iPhone 15"
        color: "blue"
        storage: "128GB"
      }
    }
  ) {
    id
    sku
    data
  }
}
```

## Best Practices

1. **Use specific filters**: Filter at the database level using WhereInput rather than loading all data and filtering client-side.
2. **Leverage logical operators**: Combine `and`, `or`, and `not` for complex filtering logic.
3. **Case-insensitive search**: Use `*EqualFold` and `*ContainsFold` for user-friendly search functionality.
4. **Relationship filtering**: Use `has...With` predicates to filter based on related entity properties.
5. **Date ranges**: Combine `*GTE` and `*LT` for effective date range queries.
6. **Null handling**: Use `*IsNil` and `*NotNil` predicates to handle optional fields properly.

## Related Documentation

* [GraphQL Queries](/graphql-api/queries.md) - How to use input types in queries
* [GraphQL Mutations](/graphql-api/mutations.md) - How to use input types in mutations
* [GraphQL Types](/graphql-api/types.md) - Entity types that these inputs relate to
* [Error Handling](/graphql-api/error-handling.md) - Common errors when using input types


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/inputs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
