Graphql-engine: _inc operator works only for Int fields

Created on 19 Dec 2019  ·  8Comments  ·  Source: hasura/graphql-engine

In Hasura console I see the following description for _inc opertor:

input type for incrementing integer columne

But I read in your blog here, that it should work for any numeric field. Where is the truth?

server quickfix high

Most helpful comment

@gvNN7 This issue is something we would like to pick up and we are figuring out its priority.

All 8 comments

@marionschleifer if it's a right behaviour now, I would convert this issue to an enhancement request, to extrapolate the _inc operator to all numeric fields, not only Int.

Any update on this? I'm facing the same issue, trying to using _inc in a numeric field like sayed on blog..

Using the "_inc" operator
The _inc operator atomically increments the existing value of one or more columns by a given amount. This operator is only for columns that have a “numeric” type, like integer, numeric, float, double etc.

@gvNN7 This issue is something we would like to pick up and we are figuring out its priority.

This issue is a blocker for us because we work with money transactions with lots of numeric fields and for that reason we cannot yet adopt hasura!
Is there any workaround? Any timeline on when will this be fixed?

@perrosnk We will pick this up ASAP.

@tirumaraiselvan Is there any chance that this gets included in v.1.2?

@perrosnk There is a slim chance but it will definitely be included in v1.3.

I've created a table with various field types to see which column types support _inc. The results are as follows:

Column types that appear to support _inc: smallint, integer, bigint.

Column types that do not yet appear to support _inc: real, doubleprec, money, numeric.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hooopo picture hooopo  ·  3Comments

tirumaraiselvan picture tirumaraiselvan  ·  3Comments

marionschleifer picture marionschleifer  ·  3Comments

cpursley picture cpursley  ·  3Comments

bogdansoare picture bogdansoare  ·  3Comments