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

[MongoDB]: Unable to retrieve id property value for inner nodes #61

Open
srieeni opened this issue Feb 25, 2024 · 0 comments
Open

[MongoDB]: Unable to retrieve id property value for inner nodes #61

srieeni opened this issue Feb 25, 2024 · 0 comments

Comments

@srieeni
Copy link

srieeni commented Feb 25, 2024

Hi Team,

Thank you so much for this wonderful library and maintaining it with good documentation.

I am following github mongodb-hotchocolate examples and able to spinup a graphql server and its working well serving required data with projections.

One issue that we are seeing is, it returns null value for id field on inner nodes.

Example:

{
"id": "Root123",
"field1" : "value",
"address": {
"id": "123"
"city":"Boston"
}
}

query T {
orders {
id
address {
id
city
}
}

Above query is returning us below output:

{
"orders": {

   "id": "Root123",
   "address": {
      "id": null                        ========> this id field is cocming as NULL
      "city":"Boston"
    }
}

}

Is this default behavior for hotcolate-mongodb resolvers? How can we override this behavior and fix this issue?

Thank you.

nirzaf added a commit to nirzaf/hotchocolate-examples that referenced this issue Aug 8, 2024
…ample

Related to ChilliCream#61

Add an `Id` field to the `Address` class in `misc/MongoDB/12.1/Person/Address.cs`.

* Add a new `Id` field of type `Guid` to the `Address` class.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/ChilliCream/hotchocolate-examples/issues/61?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant