malta-apollo-srv

Malta plugin to start apollo server.


Keywords
malta, malta plugin, malta apollo, malta apollo server, malta apollo plugin
License
MIT
Install
npm install malta-apollo-srv@1.0.2

Documentation


npm version npm downloads npm downloads

This plugin is highly experimental, can be used on all files:

Parameters :
- types : a folder (relative to malta execution one) where an index.js will export all needed types
- resolvers : a folder (relative to malta execution one) where an index.js will export all needed resolvers
- context: a path to a file that will export the needed context to be used in Apollo - port: this is optional, default is 4000 - host: this is optional, default is localhost

Sample usage:

malta app/source/index.html public -plugins=malta-apollo-srv[types:\"graphql/types\",resolvers:\"graphql/resolvers\",context:\"graphql/context\"]

or in the .json file :

"app/source/index.html" : "public -plugins=malta-apollo-srv[types:'graphql/types',resolvers:'graphql/resolvers',context:'graphql/context']"

or in a script :

var Malta = require('malta');
Malta.get().check([
    'app/source/index.html',
    'public',
    '-plugins=malta-apollo-srv[types:\"graphql/types\",resolvers:\"graphql/resolvers\",context:\"graphql/context\"]',
    '-options=showPath:false,watchInterval:500,verbose:0'
]).start();

a full example can be found here