Practical GraphQL - Become a GraphQL Ninja - Preparing the model for authentication

Practical GraphQL - Become a GraphQL Ninja - Preparing the model for authentication

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial covers extending a user model to include username and password fields, updating dummy data to align with the new model, and implementing password hashing using bcrypt. It explains how to add custom instance methods in SQL Elize and demonstrates the use of async/await for handling promises during password hashing. The tutorial emphasizes the importance of securing passwords by hashing them before database insertion.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is it important to set the username field as unique in the user model?

To prevent users from having passwords

To allow multiple users to have the same username

To ensure each user has a distinct identifier

To make the database queries faster

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What should be done to the dummy data file after updating the user model?

Change all usernames to uppercase

Remove all validation rules

Add username and password fields to match the new model

Delete all existing data

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a major security risk of storing passwords in plain text?

It makes password recovery difficult

It increases the size of the database

It allows unauthorized access if the database is compromised

It makes the database slower

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using instance methods in the context of password hashing?

To create new database tables

To delete rows from the database

To perform actions on individual rows during insertion

To apply hashing to all rows at once

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which JavaScript feature is used to handle promises when hashing passwords?

Event listeners

Async/await

Synchronous functions

Callbacks

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What library is used for hashing passwords in this tutorial?

HashLib

bcrypt

SecureHash

CryptoJS

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is it important to avoid using arrow functions when accessing 'this' in JavaScript?

Arrow functions are not supported in all browsers

Arrow functions cannot be used in classes

Arrow functions do not bind 'this' correctly

Arrow functions are slower