Float Field

Sample Float Query

Query

{
products {
name
rating
}
}

Output

{
"data": {
"products": [
{
"rating": 100
},
{
"rating": 50
}
]
}
}

Filtering by Float

Float filters support:

  • _not
  • _in
  • _not_in
  • _lt
  • _lte
  • _gt
  • _gte

rating: Int

{
products(where: { rating: 4.5 }) {
name
rating
}
}

rating_not: Int

All values that are not equal to given value.

{
products(where: { rating_not: 2.5 }) {
name
rating
}
}

rating_in: [Int!]

All values that are contained in given list.

{
products(where: { rating_in: [3.5] }) {
name
rating
}
}

rating_not_in: [Int!]

All values that are not contained in given list.

{
products(where: { rating_not_in: [1, 1.5, 2] }) {
name
rating
}
}

rating_lt: Int

All values less than the given value.

{
products(where: { rating_lt: 3 }) {
name
rating
}
}

rating_lte: Int

All values less than or equal the given value.

{
products(where: { rating_lte: 3 }) {
name
rating
}
}

rating_gt: Int

All values greater than the given value.

{
products(where: { rating_gt: 3 }) {
name
rating
}
}

rating_gte: Int

All values greater than or equal to the given value.

{
products(where: { rating_gte: 4.5 }) {
name
rating
}
}

Mutating a Float

mutation {
createProduct(data: { rating: 4.5 }) {
name
rating
}
}

Were you expecting something more?

We are constantly contributing to our documentation, but if you spot something we're missing, let us know and we'll be sure to add it.

This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy