Complete the code to define an enum type for colors.
enum Color {
RED
GREEN
[1]
}The enum type Color includes RED, GREEN, and BLUE as valid values.
Complete the code to use the enum type Status in a GraphQL schema.
type Task {
id: ID!
title: String!
status: [1]
}The status field uses the Status enum type to restrict its values.
Fix the error in the enum definition by completing the missing value.
enum Direction {
NORTH
EAST
SOUTH
[1]
}The enum Direction should include the four main compass points: NORTH, EAST, SOUTH, and WEST.
Fill both blanks to define an enum and use it in a type.
enum Priority {
[1]
LOW
MEDIUM
}
type Issue {
id: ID!
priority: [2]
}The enum Priority includes HIGH, LOW, and MEDIUM. The priority field in Issue uses the Priority enum type.
Fill all three blanks to define an enum, use it in a type, and set a default value.
enum Role {
[1]
USER
ADMIN
}
input User {
id: ID!
role: [2] = [3]
}The enum Role includes GUEST, USER, and ADMIN. The role field in User uses the Role enum type with a default value of GUEST.