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
  • Required package
  • Installation

Was this helpful?

Introduction

NextUsage

Last updated 4 years ago

Was this helpful?

Use this package with directives to quickly and easily describe your GraphQL circuit.

There are currently directives in the package to make CRUD based on them.

Also, there are directives for building simple relationships such as HasOne, HasMany, BelongsTo.

The package will continue to develop, but it depends on the needs of the author. The author will always be happy on your feedback of issue or Pull Request.

Required package

adonisjs: 4+

apollo-server-adonis

Installation

Install from npm

npm i apollo-server-adonis-directives-pack

Import to your app

const { makeExecutableSchema } = require('graphql-tools')
const { 
    TypeDefsDirective,
    SchemaDirective 
} = require('apollo-server-adonis-directives-pack')

module.exports = makeExecutableSchema({
    TypeDefs: TypeGefsDirective,
    schemaDirectives: SchemaDirective,
    /* ... */
})

/* or */

const { makeExecutableSchema } = require('graphql-tools')
const { 
    TypeDefsDirective,
    SchemaDirective 
} = require('apollo-server-adonis-directives-pack')

module.exports = makeExecutableSchema({
    TypeDefs: [...TypeGefsDirective, /* ... */],
    schemaDirectives: { ...SchemaDirective, /* ... */},
    /* ... */
})
🥳