@belongsTo
Belongs to (one or more)
For a separate add use
/* ... */
const {
BelongsToDirective,
BelongsToTypeDefs
} = require('apollo-server-adonis-directives-pack/src/directives/relationship/BelongsTo')
makeExecutableSchema({
/* ... */
typeDefs: [ BelongsToTypeDefs, /* ... */ ],
schemaDirectives: { BelongsToDirective, /* ... */}
})Definition
directive @belongsTo(
# By default, the model will be calculated from the name
# of the returned "type" with the prefix 'App/Model/'
model: String,
# By default ownerColumn = 'id'
ownerColumn: String,
# By default, the column will be calculated from the name
# of the returned "type" with the postfix '_id'
localColumn:String) on FIELD_DEFINITIONExample
Last updated
Was this helpful?