0.0.2 • Published 4 years ago

apollo-datasource-knex v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

apollo-datasource-knex

This package depends on knex and implements DataSource.

npm version

Getting Started

Installation

To install apollo-datasource-knex: npm i apollo-datasource-knex

Usage

import { KnexDataSource } from 'apollo-datasource-knex';
import Knex from 'knex';

const knexConfig: Knex.Config = {
    connection: {
        /* connection info */
    }
};

const dbOne = new KnexDataSource(knexConfig);

const server = new ApolloServer({
    dataSources: () => ({ dbOne })
});
0.0.2

4 years ago

0.0.1

4 years ago