You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARN [2021-10-18 14:31:33,337] notprivacysafe.graphql.execution.SimpleDataFetcherExceptionHandler: Exception while fetching data (/inserttest) : null
java.lang.NullPointerException: null
! at io.stargate.graphql.schema.cqlfirst.dml.fetchers.DataTypeMapping.convertCollection(DataTypeMapping.java:70)
! at io.stargate.graphql.schema.cqlfirst.dml.fetchers.DataTypeMapping.toDBValue(DataTypeMapping.java:45)
! at io.stargate.graphql.schema.cqlfirst.dml.fetchers.DmlFetcher.toDBValue(DmlFetcher.java:224)
This happens when inserting null for columns c, d, and e as well.
Would the fix be to make methods such as convertCollection, convertMap, etc. in DataTypeMapping return null when graphQLValue is null or is there more to this?
For context, we're migrating some use cases to Stargate that insert null values to remove existing values, which is why we'd like to maintain parity with CQL.
cqlsh> insert into type_test.test(a, b, c, d, e) VALUES (2, null, null, null, null);
cqlsh> select * from type_test.test ;
a | b | c | d | e
---+------+----------+--------+------------------
1 | [2] | {3: '3'} | (4, 4) | {one: 1, two: 2}
2 | null | null | null | null
We're aware that we could insert null if we omit this field from a mutation but this doesn't work for upserts where we'd like to overwrite existing values with null. Thanks!
The text was updated successfully, but these errors were encountered:
Yes we need to fix that.
For lists I think passing an empty list would achieve the same effect since CQL considers empty list and null the same, but it will be more user-friendly to accept null as well.
We noticed that GraphQL API throws an exception when we try to insert
null
for some data types: list, map, tuple and udt.For example, if there's a table such as
the schema for
testInput
is the following, note that the types are nullable:When we pass
null
as the value for the list type:we get the following exception:
This happens when inserting
null
for columnsc
,d
, ande
as well.Would the fix be to make methods such as
convertCollection
,convertMap
, etc. in DataTypeMapping returnnull
whengraphQLValue
isnull
or is there more to this?For context, we're migrating some use cases to Stargate that insert
null
values to remove existing values, which is why we'd like to maintain parity with CQL.We're aware that we could insert
null
if we omit this field from a mutation but this doesn't work for upserts where we'd like to overwrite existing values withnull
. Thanks!The text was updated successfully, but these errors were encountered: