Complete the code to define a one-to-one relationship field in GraphQL schema.
type User {
id: ID!
profile: [1]
}The profile field should be of type Profile to represent a one-to-one relationship.
Complete the code to define the inverse one-to-one relationship field in the related type.
type Profile {
id: ID!
user: [1]
}The user field should be of type User to represent the one-to-one inverse relationship.
Fix the error in the GraphQL schema for one-to-one relationship by completing the field type.
type User {
id: ID!
profile: [1]
}
type Profile {
id: ID!
user: [User]
}The profile field in User must be Profile (not a list) to correctly represent a one-to-one relationship.
Fill both blanks to complete the GraphQL schema for a one-to-one relationship with non-nullable fields.
type User {
id: ID!
profile: [1]!
}
type Profile {
id: ID!
user: [2]!
}!.Both sides use the related type without list brackets and are marked non-nullable with ! to enforce one-to-one.
Fill all three blanks to complete the GraphQL schema with one-to-one relationship and ID references.
type User {
id: [1]!
profileId: [2]
profile: [3]
}The id and profileId fields use ID type, and profile field uses the related Profile type.