@find
Request one "Lucid" model by primary key
Required argument when writing a request
- id - String/Int/ID 
Other arguments are ignored.
For a separate add use
/* ... */
const {
  FindDirective,
  FindTypeDefs
} = require('apollo-server-adonis-directives-pack/src/directives/query/Find')
makeExecutableSchema({ 
  /* ... */ 
  typeDefs: [ FindTypeDefs, /* ... */ ],
  schemaDirectives: { FindDirective, /* ... */} 
})Definition
directive @find(
  # By default, the model will be calculated from the name
  # of the returned "type" with the prefix 'App/Model/'
  model: String
) on FIELD_DEFINITIONExample
type Query {
    postFind(id: String!): Post @find
}Last updated
Was this helpful?
