forked from moleculerjs/moleculer-apollo-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (42 loc) · 1.18 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* moleculer-apollo-server
*
* Apollo Server for Moleculer API Gateway.
*
* Based on "apollo-server-micro"
*
* https://github.com/apollographql/apollo-server/blob/master/packages/apollo-server-micro/
*
*
* Copyright (c) 2020 MoleculerJS (https://github.com/moleculerjs/moleculer-apollo-server)
* MIT Licensed
*/
"use strict";
const core = require("apollo-server-core");
const { GraphQLUpload } = require("graphql-upload");
const { ApolloServer } = require("./src/ApolloServer");
const ApolloService = require("./src/service");
const gql = require("./src/gql");
module.exports = {
// Core
GraphQLExtension: core.GraphQLExtension,
gql: core.gql,
ApolloError: core.ApolloError,
toApolloError: core.toApolloError,
SyntaxError: core.SyntaxError,
ValidationError: core.ValidationError,
AuthenticationError: core.AuthenticationError,
ForbiddenError: core.ForbiddenError,
UserInputError: core.UserInputError,
defaultPlaygroundOptions: core.defaultPlaygroundOptions,
// GraphQL tools
...require("graphql-tools"),
// GraphQL Upload
GraphQLUpload,
// Apollo Server
ApolloServer,
// Apollo Moleculer Service
ApolloService,
// Moleculer gql formatter
moleculerGql: gql,
};