/
index.ts
62 lines (52 loc) · 2.05 KB
/
index.ts
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
51
52
53
54
55
56
57
58
59
60
61
62
import 'apollo-server-env';
export { runHttpQuery, HttpQueryRequest, HttpQueryError } from './runHttpQuery';
export {
default as GraphQLOptions,
resolveGraphqlOptions,
PersistedQueryOptions,
} from './graphqlOptions';
export {
ApolloError,
toApolloError,
SyntaxError,
ValidationError,
AuthenticationError,
ForbiddenError,
UserInputError,
formatApolloErrors,
} from 'apollo-server-errors';
export { convertNodeHttpToRequest } from './nodeHttpToRequest';
export {
createPlaygroundOptions,
PlaygroundConfig,
defaultPlaygroundOptions,
PlaygroundRenderPageOptions,
} from './playground';
// ApolloServer Base class
export { ApolloServerBase, ApolloServerServerlessFrameworkBase } from './ApolloServer';
export * from './types';
export * from './requestPipelineAPI';
// This currently provides the ability to have syntax highlighting as well as
// consistency between client and server gql tags
import { DocumentNode } from 'graphql';
import gqlTag from 'graphql-tag';
export const gql: (
template: TemplateStringsArray | string,
...substitutions: any[]
) => DocumentNode = gqlTag;
import runtimeSupportsUploads from './utils/runtimeSupportsUploads';
import { GraphQLScalarType } from 'graphql';
export { default as processFileUploads } from './processFileUploads';
// This is a conditional export intended to avoid traversing the entire module
// tree of `graphql-upload` (or specifically, our fork of it). This only
// defined if the version of Node.js is >= 8.5.0 since those are the only
// Node.js versions which are supported by `graphql-upload@8`. Since the source
// of `graphql-upload` is not transpiled for older targets (in fact, it includes
// experimental ECMAScript modules), this conditional export is necessary to
// avoid modern ECMAScript from failing to parse by versions of Node.js which
// don't support it (yet — eg. Node.js 6 and async/await).
export const GraphQLUpload = runtimeSupportsUploads
? (require('@apollographql/graphql-upload-8-fork')
.GraphQLUpload as GraphQLScalarType)
: undefined;
export * from './plugin';