directive @hasOne(
# By default, the model will be calculated from the name
# of the returned "type" with the prefix 'App/Model/'
model: String,
# By default, the column will be calculated from the name
# of the "type" with the postfix '_id'
ownerColumn: String,
# By default localColumn = 'id'
localColumn:String) on FIELD_DEFINITION
Example
type User {
id: ID!
name: String
token: Token @hasOne #ownerColumn: user_id
}
type Token {
hash: String
user_id: Int!
}
This directive uses a DataLoader but does not cache the results.