Open abhishekkumams opened 1 year ago
@Aniruddh25, should we do this as well (Now, that we know how to do it and it will be easier to consume). Maybe we can take this up in a future milestone?
@abhishekkumams, makes sense - I wonder why is that the case isn't Date type mapped to HotChocolate Date? https://chillicream.com/docs/hotchocolate/v13/defining-a-schema/scalars#net-scalars
@abhishekkumams, makes sense - I wonder why is that the case isn't Date type mapped to HotChocolate Date? https://chillicream.com/docs/hotchocolate/v13/defining-a-schema/scalars#net-scalars
Nope, It's mapped to DateTime
@abhishekkumams,
I went back into the previous changes and found this reasoning in the commit: https://github.com/Azure/data-api-builder/commit/63d5ef24e3bb90057fed015caa1d81f222de232a:
- DateTime This is a bit of a tricky one.
DateTime
type is handled by HotChocolate asDateTimeOffset
. Also, our db column type detection method givesDateTime
for allDate
,DateTime
, andDateTimeOffset
. Meaning that while the user can define nonDateTimeOffset
columns, they will be interpreted asDateTimeOffset
and the gaps will be filled with 00:00:00 time and local offset. HotChocolate also provides us withDate
type. However, because all db column typesDate
,DateTime
, andDateTimeOffset
are detected asDateTime
system types, we cannot make use of the HotChocolateDate
type as of now.
So, to solve this, we would need to look for alternative ways for db column type to system type detection method other than ADO.NET Db Data provider.
@ayush3797 is this duplicate or secondary to your date work?
@ayush3797 is this duplicate or secondary to your date work?
Its not.
@abhishekkumams i wonder if your work enabling SqlDbType SqlParameter work would help here. When reading the db schema from MsSql, are we able to parse out a specific SqlDbType? or are we still restricted to the limitations of DbType values as explained in Ani's quote
DateTime https://github.com/Azure/data-api-builder/commit/63d5ef24e3bb90057fed015caa1d81f222de232a This is a bit of a tricky one. DateTime type is handled by HotChocolate as DateTimeOffset. Also, our db column type detection method gives DateTime for all Date, DateTime, and DateTimeOffset. Meaning that while the user can define non DateTimeOffset columns, they will be interpreted as DateTimeOffset and the gaps will be filled with 00:00:00 time and local offset. HotChocolate also provides us with Date type. However, because all db column types Date, DateTime, and DateTimeOffset are detected as DateTime system types, we cannot make use of the HotChocolate Date type as of now.
Currently, GraphQL response is showing DateTimeFormat for date type columns.
If the value stored in the DB is
11-03-2017
, graphql will show11-03-2017T00:00:00Z
.