Skip to content

Translating GraphQL input for a model with a has-many creates null value (incorrectly) #2483

@lawmicha

Description

@lawmicha

bug where collections's are being set to nil in the GraphQL input, so for example, when creating a Post and saving it through DataStore. the sync process will translate the post to the GraphQL input variables containing

{
  "id": "postid123",
   "comments": null
}

The problem is this fails as there's no input type "comments". We should skip has-many relationships like in this code snippet. This can be done in main and v1

Originally posted by @lawmicha in #2448 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdatastoreIssues related to the DataStore category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions