Skip to content

model.hasInverseFor is not a function #77

@rgaiacs

Description

@rgaiacs

I have a mutation updateSoftwareSourceCode(input: $input) and the variable input is

{
  "input": {
    "codeRepository": "https://github.com/foo/bar",
    "format": "SCRIPTS",
    "name": "Foo",
    "description": "A method.",
    "categories": [
      "WEB_SCRAPING"
    ],
    "keywords": [
      "Scientific Online Discourse",
      "Science-relatedness",
      "Tweets",
      "NLP"
    ],
    "version": "1.0",
    "downloadUrl": "https://codeload.github.com/foo/bar/zip/refs/heads/main",
    "documentationLink": "https://github.com/foo/bar/blob/main/annotation_framework.pdf",
    "programmingLanguage": "Python",
    "runtimePlatform": "Python 3.8",
    "datasetUsages": [
      {
        "isInput": true,
        "isOutput": false,
        "datasetId": "1"
      }
    ],
    "contributors": [
      {
        "isSubmitter": true,
        "isMaintainer": true,
        "personId": "10"
      }
    ],
    "scholarlyArticle": {
      "title": "foo",
      "doi": "foo/bar",
      "url": "https://dl.acm.org/doi/foo/bar"
    },
    "id": "7"
  }
}

Mirage GraphQL raises the following error

{
  "errors": [
    {
      "message": "model.hasInverseFor is not a function",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "updateSoftwareSourceCode"
      ]
    }
  ]
}

miragejs/ember-cli-mirage#1216 (comment) indicates that this might be related with

Mirage's ORM expects foreign key names to be *Id or *Ids.

Would be great to know which field raise the error. Is this something that should be submitted upstream?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions