GraphQL Mutations error

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

I tried to use the graphql mutations in below format but returns query error. maybe i’m using a wrong form. Kindly help with an example to create a content.

   mutation {
       createJobContent(firstName:"Tim",lastName:"George")
    }

Expected behavior

Minimal reproduction of the problem

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ X] Cloud version

Version: [VERSION]

Browser:

  • [X ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Can you post the full query?

mutation {
      createJobContent(data:{ title: "Sample", company: "Diliveroo"}) {
        data{
          title{
            en
          }
          company{
            en
          }
        }
      }
    }

Still thinking format issue.

I am not a graphql expert, but it looks very wrong. You need a correct payload, something like

mutation {
      createJobContent(data:{ title: { en:  "Sample" }) {
        data{
          title{
            en
          }
          company{
            en
          }
        }
      }
    }

GraphiQL should provide you the correct format.