graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

mutations should use the same key for data in outer and inner tables

Open tirumaraiselvan opened this issue 7 years ago • 2 comments

Currently, we use objects for outer table and data for inner table:

mutation insert_article {
  insert_article(
    objects: [
      {
        id: 21,
        title: "Article 1",
        content: "Sample article content",
        author: {
          data: {
            id: 11,
            name: "Cory"
          }
        }
      }
    ]
  ) {
    affected_rows
    returning {
      id
      title
      author {
        id
        name
      }
    }
  }
}

Possible options:

  1. Use objects in both
  2. Use data in both
  3. Use objects or object based on relationship type

tirumaraiselvan avatar Mar 18 '19 12:03 tirumaraiselvan

I vote for no. 3. Objects or object in upsert makes more sense.

Also, will this be a breaking change? @0x777

coco98 avatar Mar 19 '19 09:03 coco98

This issue will now be reviewed and tracked as part of the Hasura V3 roadmap.

manasag avatar Dec 28 '23 17:12 manasag