Int

32-bit signed integer scalar type

Audience: Programmer

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Format

  • 32-bit signed integer

  • Range: -2,147,483,648 to 2,147,483,647

  • No decimal places

  • No thousand separators

Usage

type Stock {
  quantity: Int!
  ownQuantity: Int!
  incomingStock: Int!
  outgoingStock: Int!
}

query {
  inventoryItems(
    first: 10  # Int parameter
  ) {
    edges {
      node {
        itemstocks {
          quantity
        }
      }
    }
  }
}

Common Int Fields

  • Quantities and counts

  • Pagination limits (first, last)

  • Array indices

  • Version numbers

  • Port numbers

Filtering

Int fields typically support:

  • field_GT - Greater than

  • field_GTE - Greater than or equal

  • field_LT - Less than

  • field_LTE - Less than or equal

  • field_IN - Match any value in list

Limitations

For values outside the Int range, consider:

  • Using Float for larger numbers

  • Using String for arbitrary precision

  • Custom scalars for specific domains

See Also

Last updated

Was this helpful?