GraphQL error: variable price of type Float is used in position expecting float8

GraphQL error: variable price of type Float is used in position expecting float8

我在将数据从 Apollo 发送到 Hasura GraphQL 时出错:

Error: GraphQL error: variable price of type Float is used in position expecting float8

这是我在 nuxt js 中的代码

import gql from 'graphql-tag';

const insert = gql`
mutation insert_test_float($price:Float){
  insert_test_float(objects: {price: $price}) {
    affected_rows
  }
}

save() {
  const price =  this.frm.price
  this.$apollo
    .mutate({
      mutation: insert, //require('~/apollo/mutations/test'),
      variables: {
        price: this.frm.price
      }
    })
    .then((rs) => {
      console.log(rs)
    })
    .catch((er) => {
      console.log(er)
    })
}

您应该使用 float8 作为您的变量类型,而不是错误指示的 Float