Mutation Inputs
CreateInput and UpdateInput types for GraphQL mutations
Audience: Programmer
CreateInput and UpdateInput types define the structure of data accepted by create and update mutations in the pyck GraphQL API. These input types ensure type safety and validation when modifying data.
Naming Patterns
pyck follows consistent naming patterns for mutation inputs:
Create:
Create[Entity]Input(e.g.,CreateInventoryItemInput)Update:
Update[Entity]Input(e.g.,UpdateInventoryItemInput)
CreateInput Types
CreateInput types define required and optional fields when creating new entities.
Common Structure
input CreateEntityInput {
# Required fields
name: String!
type: EntityType!
# Optional fields
description: String
data: Map
# Relationships
parentId: ID
categoryIds: [ID!]
}Example: Creating an Inventory Item
UpdateInput Types
UpdateInput types define which fields can be modified when updating existing entities. All fields are typically optional, allowing partial updates.
Common Structure
Example: Updating an Inventory Item
Available Input Types
Inventory Management
CreateInventoryItemInput
UpdateInventoryItemInput
Products and items
CreateRepositoryInput
UpdateRepositoryInput
Storage locations
CreateItemMovementInput
UpdateItemMovementInput
Item movements
CreateRepositoryMovementInput
UpdateRepositoryMovementInput
Bulk movements
CreateCollectionMovementInput
UpdateInventoryCollectionInput
Collection movements
CreateInventoryItemSetInput
UpdateInventoryItemSetInput
Item groupings
Order Management
CreatePickingOrderInput
UpdatePickingOrderInput
Picking orders
CreatePickingOrderItemInput
UpdatePickingOrderItemInput
Order line items
CreateReceivingInboundInput
UpdateReceivingInboundInput
Inbound shipments
CreateReceivingInboundItemInput
UpdateReceivingInboundItemInput
Inbound items
Master Data
CreateCustomerInput
UpdateCustomerInput
Customer records
CreateSupplierInput
UpdateSupplierInput
Supplier records
CreateDataTypeInput
UpdateDataTypeInput
JSON schema definitions
System Configuration
CreateFileInput
UpdateFileInput
File attachments
CreateWorkflowInput
UpdateWorkflowInput
Workflow definitions
CreateWorkflowSignalInput
UpdateWorkflowSignalInput
Workflow triggers
Common Fields
Data Field
Most entities support a flexible data field of type Map for custom attributes:
Timestamps
Create/Update timestamps are automatically managed:
createdAt: Set automatically on creationupdatedAt: Updated automatically on modification
Relationships
Input types handle relationships through ID references:
Best Practices
1. Partial Updates
Only include fields you want to change in update mutations:
2. Null Handling
Use null to explicitly clear optional fields:
3. Data Field Validation
The data field is validated against DataType schemas:
4. Batch Operations
For bulk updates, consider using specialized batch mutations when available:
JavaScript Example
See Also
Individual mutation documentation for specific input requirements
WhereInput Types for filtering in batch operations
Data Types for data field validation
Error Handling for validation error responses
Last updated
Was this helpful?
