Skip to content

Create multiple elements when using the mutation createOneTable #378

Closed Answered by GioPat
GioPat asked this question in Q&A
Discussion options

You must be logged in to vote

Ok I've solved the issue by changing the variables to the following (by using an array for the create key:

{
    "file": {
    "name": "filesample",
    "url": "urlidentifier",
    "filesTags": {
      "create": [
        {
          "tag": {
            "connectOrCreate": {
              "where": {
                "name": "tag1"
              },
              "create": {
                "name": "tag1"
              }
            }
          }
        },
        {
          "tag": {
            "connectOrCreate": {
              "where": {
                "name": "tag2"
              },
              "create": {
                "name": "tag2"
              }
            }
          }
    …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@GioPat
Comment options

@GioPat
Comment options

Answer selected by MichalLytek
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants