Working version

This commit is contained in:
Niklas Fondberg
2021-04-06 14:53:20 +02:00
parent 4532fbc853
commit 813f4c8e47
8 changed files with 104 additions and 15 deletions
+4 -2
View File
@@ -2,16 +2,18 @@ import dotenv from 'dotenv';
dotenv.config();
import { ApolloServer } from 'apollo-server';
import knexStringcase from 'knex-stringcase';
import { dbConfig } from './config';
import { typeDefs } from './schema';
import resolvers from './resolvers';
import { OrderAPI } from './datasources/order';
const knexConfig = knexStringcase(dbConfig);
// set up any dataSources our resolvers need
const dataSources = () => ({
orderApi: new OrderAPI(dbConfig),
orderApi: new OrderAPI(knexConfig),
});
const context = async ({ req }) => {