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

model.hasInverseFor is not a function #77

Open
rgaiacs opened this issue Feb 14, 2024 · 0 comments
Open

model.hasInverseFor is not a function #77

rgaiacs opened this issue Feb 14, 2024 · 0 comments

Comments

@rgaiacs
Copy link
Contributor

rgaiacs commented Feb 14, 2024

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?

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