Skip to content

[5.x]: GraphQL mutation for nested elements does not accept entry titles #15270

@AugustMiller

Description

@AugustMiller

What happened?

Description

Steps to reproduce

Execute a GraphQL query like this:

mutation MyMutation {
 save_tours_tour_Entry(
   title: "Test from GraphQL!"
   stops: {
     entries: [
       {
         stop: {
           destination: [8],
           highlights: "First stop!",
           id: "new-first"
         }
       }
     ],
     sortOrder: [
       "new-first"
     ]
   }
 ) {
   id
 }
}

Craft will produce an error like *Title* cannot be blank.. If you provide a title key in the stop hash like this…

stop: {
  title: "Example",
  destination: [8],
  highlights: "First stop!",
  id: "new-first"
}

…a new error is emitted: Field "title" is not defined by type stops_stop_MatrixEntryInput.

Craft CMS version

5.0.0+

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggraphql ⚙️features related to the GraphQL API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions