Any
Arbitrary JSON value scalar type
Audience: Programmer
The Any scalar type represents an arbitrary JSON value of any type - object, array, string, number, boolean, or null.
Format
Accepts any valid JSON value
Can be object, array, primitive, or null
No schema validation
Serialized as JSON
Usage
type WorkflowSignal {
id: ID!
name: String!
payload: Any # Can be any JSON value
}
mutation {
createWorkflowSignal(input: {
name: "process_order"
payload: {
"orderId": "12345",
"items": [
{"sku": "ABC", "qty": 2},
{"sku": "XYZ", "qty": 1}
],
"priority": 1,
"rush": true
}
}) {
signal {
id
payload
}
}
}Valid Values
All of these are valid Any values:
Use Cases
Workflow payloads with dynamic structure
Configuration objects
Event data with varying schemas
Integration payloads
Backwards compatibility
Best Practices
Use sparingly - prefer typed fields when possible
Document expected structure
Validate on the server side
Consider using Map for object-only data
Version your payload structures
Comparison with Map
Any: Accepts any JSON value (objects, arrays, primitives)
Map: Only accepts JSON objects
See Also
Map - JSON object scalar
WorkflowSignal Type - Uses Any for payloads
Last updated
Was this helpful?
