guac icon indicating copy to clipboard operation
guac copied to clipboard

[bug] Time of 0 regarded as null when querying time fields

Open lumjjb opened this issue 2 years ago • 0 comments

Describe the bug

After ingesting a predicate with a time field of 0 (e.g. "0001-01-01T00:00:00Z"), im getting this message, which shouldn't be the case? I get error "<TRUNCATE> ingestHasSourceAt.knownSince the requested element is null which the schema does not allow\n" when

However, when it is non-zero, the error isnt thrown "knownSince": "0001-01-01T00:00:01Z",

To Reproduce

Ingest a predicate with a 0 time value

mutation hsAMutate {
  
  ingestHasMetadata(subject: {
    source: {
  	type: "git",
    namespace:"github.com/googleapis",
    name:"google-cloud-go"
      }
  },  hasMetadata:{
    key:"key1",
    value:"value1",
    justification:"justification",
    origin:"origin",
    collector: "collector",
    timestamp: "0001-01-01T00:00:00Z"
    
  }) {
    
     __typename
  }
}

Try to retrieve it

query hSAMeta {
  HasMetadata(
    hasMetadataSpec: {}
  ) {
     __typename
    key
    timestamp
  }
}

The result is

{
  "errors": [
    {
      "message": "the requested element is null which the schema does not allow",
      "path": [
        "HasMetadata",
        0,
        "timestamp"
      ]
    }
  ],
  "data": null
}

Expected behavior Should not return an error Screenshots If applicable, add screenshots to help explain your problem.

GUAC version main branch

Additional context Add any other context about the problem here.

lumjjb avatar Jul 13 '23 12:07 lumjjb