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

Issue updating 3rd nested level #53

Open
francescovenica opened this issue Jun 5, 2021 · 2 comments
Open

Issue updating 3rd nested level #53

francescovenica opened this issue Jun 5, 2021 · 2 comments

Comments

@francescovenica
Copy link

Hello,

I have a problem with a nested mutation but I'm not sure if I'm missing something or if it can't work, this is the schema I have:

CREATE TABLE media (
  uuid uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
  url text,
  alt text
);

CREATE TABLE media_gallery (
  uuid uuid PRIMARY KEY DEFAULT uuid_generate_v4 ()
);

CREATE TABLE media_gallery_item (
  uuid uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
  gallery_uuid uuid NOT NULL REFERENCES media_gallery (uuid) ON DELETE CASCADE,
  media_uuid uuid NOT NULL REFERENCES media (uuid) ON DELETE CASCADE,
  title text
);

and this is the body I'm sending:

{
    "input": {
      "patch": {
        "mediaGalleryItems": {
          "updateByUuid": [
            {
              "uuid": "938449fd-7173-42f5-b973-94c48fc61f81",
              "patch": {
                "title": "rewq 123",
                "media": {
                  "updateByUuid": {
                    "uuid": "a5d08fc0-30ea-44a3-a379-20bbb3a703e0",
                    "patch": { "alt": "ciao" }
                  }
                }
              }
            }
          ]
        }
      },
      "uuid": "09248c26-864e-46a0-8e0b-7ab0a69f2e59"
    }
  }

the title rewq 123 work fine, the alt doesn't....am I missing something?

many thanks

@Eldow
Copy link
Contributor

Eldow commented Jun 25, 2021

From what I've seen in the code, there is no recursion involved with nested updaters and deleters, only with create, but that would definitely be a nice feature, especially since the inflectors are suggesting it might work.

@Eldow
Copy link
Contributor

Eldow commented Jun 28, 2021

It actually comes down to the same issue as #29.

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

2 participants