Where Inputs
Input types for filtering objects in GraphQL queries, providing comprehensive filtering capabilities across all pyck entities.
Audience: Programmer
WhereInput types are GraphQL input types used for filtering objects in queries. They provide a comprehensive set of predicates for filtering entities based on various criteria, including field comparisons, logical operations, and relationship filtering.
Common Structure
All WhereInput types in pyck follow a consistent structure with the following components:
Logical Operators
Every WhereInput type includes these logical operators:
not
<Type>WhereInput
Negates the provided conditions
and
[<Type>WhereInput!]
All conditions must match (logical AND)
or
[<Type>WhereInput!]
At least one condition must match (logical OR)
Field Predicates
For each field in the entity, WhereInput provides various comparison operators:
Basic Comparisons
field: Equal to valuefieldNEQ: Not equal to valuefieldIn: Value is in the provided listfieldNotIn: Value is not in the provided list
Ordering Comparisons
fieldGT: Greater than valuefieldGTE: Greater than or equal to valuefieldLT: Less than valuefieldLTE: Less than or equal to value
String-Specific Operations
fieldContains: String contains substringfieldHasPrefix: String starts with prefixfieldHasSuffix: String ends with suffixfieldEqualFold: Case-insensitive equalityfieldContainsFold: Case-insensitive contains
Null Checks
fieldIsNil: Field is nullfieldNotNil: Field is not null
Relationship Filtering
For entities with relationships, WhereInput types provide:
hasRelationship: Boolean indicating if the relationship existshasRelationshipWith: Array of related entity WhereInput for complex filtering
Data Field Operations
For entities with JSON data fields, pyck provides powerful query operations:
Data: Match exact value at JSON path -Data: ["path", "value"]DataHasKey: Check if key exists at path -DataHasKey: "path"DataIn: Value at path is in list -DataIn: ["path", "value1", "value2"]DataContains: String at path contains substring -DataContains: ["path", "substring"]
Note: Data field operations are available for most WhereInput types but not for WorkflowSignalWhereInput.
Example: Find customers with name "Max" in their data field:
For comprehensive JSON field query documentation, see JSON Field Queries.
Available WhereInput Types
The following WhereInput types are available in the pyck GraphQL API:
AttachmentWhereInput
Filtering for file attachments
CompanyWhereInput
Filtering for company entities
CustomerWhereInput
Filtering for customer records
DataTypeWhereInput
Filtering for data type definitions
EventWhereInput
Filtering for system events
InventoryCollectionWhereInput
Filtering for inventory collections
InventoryItemSetWhereInput
Filtering for inventory item sets
InventoryItemWhereInput
Filtering for inventory items
ItemMovementWhereInput
Filtering for item movements
PickingOrderItemWhereInput
Filtering for picking order items
PickingOrderWhereInput
Filtering for picking orders
ReceivingInboundItemWhereInput
Filtering for receiving inbound items
ReceivingInboundWhereInput
Filtering for receiving inbound records
RepositoryMovementWhereInput
Filtering for repository movements
RepositoryWhereInput
Filtering for repository/location records
StockWhereInput
Filtering for stock records
SupplierWhereInput
Filtering for supplier records
TransactionWhereInput
Filtering for transaction records
UserWhereInput
Filtering for user accounts
WorkflowSignalWhereInput
Filtering for workflow signals
WorkflowWhereInput
Filtering for workflow records
Usage Examples
Basic Filtering
Logical Operations
Complex Filtering with OR
Negation
Relationship Filtering
Data Field Filtering
String Filtering
Date Range Filtering
Null Checks
JavaScript Usage
When using the GraphQL API from JavaScript, WhereInput objects can be constructed as regular objects:
Best Practices
Use specific field predicates: Instead of loading all data and filtering client-side, use WhereInput to filter at the database level for better performance.
Combine logical operators: Use
and,or, andnotto create complex filtering conditions that match your business logic.Leverage relationship filtering: Use
has...Withpredicates to filter based on related entity properties without separate queries.Case-insensitive searching: Use
*EqualFoldand*ContainsFoldpredicates for user-friendly search functionality.Date range queries: Combine
*GTEand*LTpredicates for effective date range filtering.Null safety: Use
*IsNiland*NotNilpredicates to handle optional fields properly.Index-friendly queries: Structure your where conditions to leverage database indexes for optimal performance.
Related Documentation
InventoryItemWhereInput - Detailed documentation for inventory item filtering
GraphQL Queries - How to use WhereInput in various queries
Error Handling - Common errors when using WhereInput types
Last updated
Was this helpful?
