autographql
GraphQL bundling and deployment library to run in any FaaS platforms
Last updated 2 months ago by antstanley .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install autographql 
SYNC missed versions from official npm registry.

AutoGraphQL

A GraphQL bundling and deployment CLI & library to make working with GraphQL and Functions as a Service (FaaS) providers easy.

The library uses Rollup and Babel for bundling and transpiling to provider specific function code. You can then use the Serverless Framework or deployment method of your choice to deploy to the supported providers.

CLI

The CLI has two commands

Developement

npx autographql dev -c ./autograph.config.json

Starts a local development server on local host.

Bundle

npx autograpqhl bundle -c ./autograph.config.json

Takes your schema and resolver code combines it with provider specific function code and outputs a bundled function.

Configuration

The cli only accepts one argument, -c which specifies the location of the configuration file.

The configuration file must be JSON. If -c is not specified autographql will attempt to load autographql.config.json. Below is a sample conifguration file

{
    "name": "graphql",
    "root": "./",
    "schema": "./src/schema/starwars.gql",
    "resolvers": "./src/resolvers",
    "openid": {
        "jwksUri": "https://<openid-tenant>/.well-known/jwks.json"
    },
    "external": [
        "package.json",
        "data"
    ],
    "providers": [
        {
            "name": "aws"
        },
        {
            "name": "now"
        },
        {
            "name": "ibm"
        },
        {
            "name": "gcp"
        },
        {
            "name": "netlify",
            "dist": "./dist/netlify",
            "zip": true
        }
    ],
    "dev": {
        "port": 7000
    }
}

Config File Options

name (String) - The name of the function to be exported

root (String) - The relative location of where the .autographql build folder should be located. Default value in the root of the current project.

schema (String) - The relative location of your GraphQL Schema file. The schema file must have a valid GraphQL schema, defined using GraphQL's Schema Definition Language. Default value is src/schema/schema.gql

resolvers (String) - Relative location of the resolver functions. Expects a folder with an index.mjs file and any other dependencies in it. The resolver functions must be written in JavaScript using ES module syntax. Default value is src/resolvers/.

openid (Object) - Optional. Specifiy options to enable OpenID Connect authentication on the GraphQL API.

jwksUri (String) - Url to the jwks.json file with the relevant key to validate a JWT token.

external (Array) - An array of files and folders that need to be copied with the resolvers. The files need to be referenced relative to the resolvers location, and can include any file type. These files will be shipped with your function. Not required, and no default value.

providers (Array) - Array of provider configuration objects consisting of the following options.

name (String) - The provider name. Valid values are aws, ibm, gcp, netlify, now. More to be added later. Required.

dist (String) - Relative location where to copy the final provider specific function for deployment. Not required. No default.

zip (Boolean) - Optional. Default value false. Must setdist. If set to true will create a zip file of the function in the root of the dist folder specified set above.

dev (Object) - Configuration detail for the development server

port (Number) - Port that the development server will run on. Default 7000.

Backlog

This project is not complete, and has a long and extensive backlog. Current backlog items to be completed before launch include.

  • Complete Test suite
  • Add Cloudflare as provider
  • Detailed documentation and website

Post launch the following items are in the backlog.

  • API defintion to allow consumption programatically
  • Resolver code generation

Current Tags

  • 0.1.27                                ...           latest (2 months ago)

28 Versions

  • 0.1.27                                ...           2 months ago
  • 0.1.26                                ...           2 months ago
  • 0.1.25                                ...           2 months ago
  • 0.1.24                                ...           2 months ago
  • 0.1.23                                ...           2 months ago
  • 0.1.22                                ...           2 months ago
  • 0.1.21                                ...           2 months ago
  • 0.1.20                                ...           2 months ago
  • 0.1.19                                ...           2 months ago
  • 0.1.18                                ...           2 months ago
  • 0.1.17                                ...           3 months ago
  • 0.1.16                                ...           3 months ago
  • 0.1.15                                ...           3 months ago
  • 0.1.14                                ...           5 months ago
  • 0.1.13                                ...           5 months ago
  • 0.1.12                                ...           5 months ago
  • 0.1.11                                ...           5 months ago
  • 0.1.10                                ...           6 months ago
  • 0.1.9                                ...           7 months ago
  • 0.1.8                                ...           7 months ago
  • 0.1.7                                ...           7 months ago
  • 0.1.6                                ...           7 months ago
  • 0.1.5                                ...           8 months ago
  • 0.1.4                                ...           8 months ago
  • 0.1.3                                ...           8 months ago
  • 0.1.2                                ...           8 months ago
  • 0.1.1                                ...           8 months ago
  • 0.1.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 1
This Week 2
This Month 30
Last Day 0
Last Week 28
Last Month 1
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |