Practical GraphQL - Become a GraphQL Ninja - Basic mutations

Practical GraphQL - Become a GraphQL Ninja - Basic mutations

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

This video tutorial explores how to use GraphQL mutations to write data. It covers creating and resolving mutations, specifically focusing on the 'Make User' and 'Remove User' functions. The tutorial includes testing these mutations in a GraphQL playground and handling potential errors. It concludes with a challenge to create additional mutations for managing car data.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of a mutation in GraphQL?

To query data

To write or modify data

To update the schema

To delete data

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the required inputs for the 'Make user' mutation?

ID and email

Name and email

Name and age

ID and name

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the resolver function for 'Make user', what is the purpose of the 'users.push' method?

To add a new user to the array

To delete a user

To update a user

To query a user

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to specify a mutation in GraphQL?

update

mutation

insert

query

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of value does the 'Remove user' mutation return?

Integer

Boolean

String

Array

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to remove a user that does not exist in the array?

The mutation returns false

The mutation returns true

An error is thrown

The array is cleared

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of reassigning the filtered array to the users variable in the 'Remove user' mutation?

To sort the array

To ensure the original array is updated

To clear the array

To create a backup of the array