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

Micronaut GraphQL as native-image does not work properly #300

Open
eratolekov opened this issue Sep 6, 2022 · 1 comment
Open

Micronaut GraphQL as native-image does not work properly #300

eratolekov opened this issue Sep 6, 2022 · 1 comment

Comments

@eratolekov
Copy link

Expected Behavior

The graphlql response:

{
  "data": {
    "products": [
      {
        "id": "1",
        "extId": "Ext34",
        "kind": "Kind2"
      }
    ]
  }
}

Actual Behaviour

The graphlql response:

{
  "errors": [
    {
      "message": "The field at path '/products[0]/id' 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 'ID' within parent type 'Product'",
      "path": [
        "products",
        0,
        "id"
      ],
      "extensions": {
        "classification": "NullValueInNonNullableField"
      }
    },
    {
      "message": "The field at path '/products[0]/extId' 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 'String' within parent type 'Product'",
      "path": [
        "products",
        0,
        "extId"
      ],
      "extensions": {
        "classification": "NullValueInNonNullableField"
      }
    },
    {
      "message": "The field at path '/products[0]/kind' 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 'String' within parent type 'Product'",
      "path": [
        "products",
        0,
        "kind"
      ],
      "extensions": {
        "classification": "NullValueInNonNullableField"
      }
    }
  ],
  "data": {
    "products": [
      null
    ]
  }
}

Steps To Reproduce

Build the micronaut native-image application:

./gradlew nativeCompile

Run the micronaut native-image application:

./build/native/nativeCompile/graphql-native-bug

Open the url http://localhost:8080/graphiql

Execute the graphql query:

{
  products {
    id
    extId
    kind
  }
}

See the graphql response.

Though the micronaut openjdk application works properly.
The actual result of the micronaut openjdk application is presented at Expected Behaviour section above.

Environment Information

  • OS Ubuntu 20.04
  • graalvm-ce-java17-22.1.0

Example Application

https://github.com/eratolekov/micronaut-graphql-native-bug

Version

3.6.2

@eratolekov eratolekov changed the title Micronaut GraphQL does not work properly Micronaut GraphQL as native-image does not work properly Sep 7, 2022
@graemerocher graemerocher transferred this issue from micronaut-projects/micronaut-core Sep 7, 2022
@rmberg
Copy link

rmberg commented Feb 3, 2023

Curious to know if there is any update on this issue? I am experiencing it as well.

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

No branches or pull requests

3 participants