Skip to main content
You're reading the V1 docs. They cover the first generation of Intuition: the intuition-ts packages and the intuition-rs services. New development happens in V2. Open the V2 docs
Version: V1

Use Variables

Always use variables for dynamic values instead of hardcoding.

Anti-Pattern​

# BAD: Hardcoding values
query {
atoms(where: { type: { _eq: Person } }) {
term_id
label
}
}

Best Practice​

# GOOD: Using variables
query GetAtomsByType($type: atom_type!) {
atoms(where: { type: { _eq: $type } }) {
term_id
label
}
}

Variables:

{
"type": "Person"
}

Benefits​

  1. Reusability: Same query, different values
  2. Type safety: GraphQL validates variable types
  3. Security: Prevents injection attacks
  4. Caching: Better query plan caching