Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter field is null for node when event type is error #1960

Closed
fjtirado opened this issue Jan 18, 2024 · 0 comments · Fixed by #1961
Closed

Enter field is null for node when event type is error #1960

fjtirado opened this issue Jan 18, 2024 · 0 comments · Fixed by #1961
Assignees

Comments

@fjtirado
Copy link
Contributor

fjtirado commented Jan 18, 2024

Describe the bug

Issue apache/incubator-kie-issues#576 added a small change related with Node event types (a new state EVENT_TYPE_ERROR.
https://github.com/elguardian/kogito-apps/blob/d157e3a7595db61963c45d97173b22b02cbf335e/data-index/data-index-common/src/main/java/org/kie/kogito/index/event/mapper/ProcessInstanceNodeDataEventMerger.java#L72C13-L74C23
When the event is of this type, the enter field might be left empty, but according to graphql definition, enter is not nullable, causing this exception

Full Error as JSON
{
  "error": {
    "name": "CombinedError",
    "message": "[GraphQL] The field at path '/ProcessInstances[0]/nodes[7]/enter' was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value.  The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is 'DateTime' within parent type 'NodeInstance'\n[GraphQL] The field at path '/ProcessInstances[0]/nodes[8]/enter' was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value.  The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is 'DateTime' within parent type 'NodeInstance'",
    "graphQLErrors": [
      {
        "message": "The field at path '/ProcessInstances[0]/nodes[7]/enter' was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value.  The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is 'DateTime' within parent type 'NodeInstance'",
        "path": [
          "ProcessInstances",
          0,
          "nodes",
          7,
          "enter"
        ],
        "extensions": {
          "classification": "NullValueInNonNullableField"
        }
      },
      {
        "message": "The field at path '/ProcessInstances[0]/nodes[8]/enter' was declared as a non null type, but the code involved in retrieving data has wrongly returned a null value.  The graphql specification requires that the parent field be set to null, or if that is non nullable that it bubble up null to its parent and so on. The non-nullable type is 'DateTime' within parent type 'NodeInstance'",
        "path": [
          "ProcessInstances",
          0,
          "nodes",
          8,
          "enter"
        ],
        "extensions": {
          "classification": "NullValueInNonNullableField"
        }
      }
    ],
    "response": {}
  },
  "request": {
    "method": "GET",
    "url": "/instances/b9af370f-b873-4191-a43a-2b50bfd9d0e3"
  },
  "response": {
    "statusCode": 500
  }
}

Expected behavior

Enter should be always filled

Actual behavior

Enter is null when even type is error

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant