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.

For a complete list of all available WhereInput types, see the WhereInput Types Overview.

Workflow Input Types

Input types for workflow-related operations:

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:

Logical Operators

All WhereInput types support logical operations:

Relationship Filtering

Entities with relationships provide filtering on related entities:

Data Field Operations

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

For detailed information on JSON field queries, including path syntax and advanced examples, see the Advanced JSON Field Queries guide.

Usage Examples

Basic Filtering

Complex Filtering

Creating Entities

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.

Last updated

Was this helpful?