Create an Input Object Type for Complex Mutations

Share this video with your friends

Send Tweet

When we have certain mutations that require more complex input parameters, we can leverage the Input Object Type in GraphQL. In this video, we’ll learn how to create an Input Object Type and how to add it to a GraphQL Mutation Type.

Albert Baliński
Albert Baliński
~ 5 years ago

The transcript doesn;t match the video :) We have:

mutation M {
  createVideo(video: {
    title: "Foo",
    duration:
  })
}

Should be:

mutation M {
  createVideo(video:{
    	title:"t",
    	duration: 1,
    	released:false
  }) {
    id, title
  }
}