Apollo-server-adonis-directive-pack
  • Introduction
  • Usage
  • API
    • Query
      • @all
      • @find
    • Mutation
      • @create
      • @createMany
      • @update
      • @delete
    • Relationship
      • @hasOne
      • @hasMany
      • @belongsTo
Powered by GitBook
On this page
  • For a separate add use
  • Definition
  • Example

Was this helpful?

  1. API
  2. Query

@all

Request all Lucid models

For a separate add use

/* ... */
const {
  AllDirective,
  AllTypeDefs
} = require('apollo-server-adonis-directives-pack/src/directives/query/All')

makeExecutableSchema({ 
  /* ... */ 
  typeDefs: [ AllTypeDefs, /* ... */ ],
  schemaDirectives: { AllDirective, /* ... */} 
})

Definition

AllTypeDefs
# returns a collection of all models of this specified return type
directive @all on FIELD_DEFINITION

Example

type Query {
    posts: [Post] @all
}
PreviousQueryNext@find

Last updated 4 years ago

Was this helpful?