mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 02:01:40 -05:00
Fix and Export Extension and Playground Types (#1360)
* export playground types * make playground configuration recursively partial
This commit is contained in:
parent
8a588929d4
commit
fa6c973f36
11 changed files with 80 additions and 15 deletions
|
@ -1,2 +1,23 @@
|
|||
export * from 'graphql-tools';
|
||||
|
||||
export { ApolloServer } from './ApolloServer';
|
||||
export { gql } from 'apollo-server-core';
|
||||
|
||||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
gql,
|
||||
// Errors
|
||||
ApolloError,
|
||||
toApolloError,
|
||||
SyntaxError,
|
||||
ValidationError,
|
||||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
|
|
@ -22,7 +22,12 @@ export {
|
|||
|
||||
export { convertNodeHttpToRequest } from './nodeHttpToRequest';
|
||||
|
||||
export { createPlaygroundOptions } from './playground';
|
||||
export {
|
||||
createPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from './playground';
|
||||
|
||||
// ApolloServer Base class
|
||||
export { ApolloServerBase } from './ApolloServer';
|
||||
|
|
|
@ -11,7 +11,16 @@ export {
|
|||
// by the integration subclasses
|
||||
const playgroundVersion = '1.7.2';
|
||||
|
||||
export type PlaygroundConfig = Partial<PlaygroundRenderPageOptions> | boolean;
|
||||
// https://stackoverflow.com/a/51365037
|
||||
type RecursivePartial<T> = {
|
||||
[P in keyof T]?: T[P] extends (infer U)[]
|
||||
? RecursivePartial<U>[]
|
||||
: T[P] extends object ? RecursivePartial<T[P]> : T[P]
|
||||
};
|
||||
|
||||
export type PlaygroundConfig =
|
||||
| RecursivePartial<PlaygroundRenderPageOptions>
|
||||
| boolean;
|
||||
|
||||
export const defaultPlaygroundOptions = {
|
||||
version: playgroundVersion,
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
gql,
|
||||
// Errors
|
||||
ApolloError,
|
||||
|
@ -10,6 +12,10 @@ export {
|
|||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export * from 'graphql-tools';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
gql,
|
||||
// Errors
|
||||
ApolloError,
|
||||
|
@ -10,6 +12,10 @@ export {
|
|||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export * from 'graphql-tools';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
gql,
|
||||
// Errors
|
||||
ApolloError,
|
||||
|
@ -10,6 +12,10 @@ export {
|
|||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export * from 'graphql-tools';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import * as lambda from 'aws-lambda';
|
||||
import { ApolloServerBase } from 'apollo-server-core';
|
||||
export { GraphQLOptions, GraphQLExtension } from 'apollo-server-core';
|
||||
import { GraphQLOptions, Config } from 'apollo-server-core';
|
||||
import {
|
||||
renderPlaygroundPage,
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
gql,
|
||||
// Errors
|
||||
ApolloError,
|
||||
|
@ -10,6 +12,10 @@ export {
|
|||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export * from 'graphql-tools';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
gql,
|
||||
// Errors
|
||||
ApolloError,
|
||||
|
@ -10,6 +12,10 @@ export {
|
|||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export * from 'graphql-tools';
|
||||
|
|
|
@ -2,6 +2,12 @@ export * from 'graphql-tools';
|
|||
export * from 'graphql-subscriptions';
|
||||
|
||||
export {
|
||||
gql,
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
Config,
|
||||
// Errors
|
||||
ApolloError,
|
||||
toApolloError,
|
||||
SyntaxError,
|
||||
|
@ -9,5 +15,10 @@ export {
|
|||
AuthenticationError,
|
||||
ForbiddenError,
|
||||
UserInputError,
|
||||
gql,
|
||||
// playground
|
||||
defaultPlaygroundOptions,
|
||||
PlaygroundConfig,
|
||||
PlaygroundRenderPageOptions,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export { CorsOptions } from 'apollo-server-express';
|
||||
|
|
|
@ -11,16 +11,6 @@ import {
|
|||
} from 'apollo-server-express';
|
||||
import { Config } from 'apollo-server-core';
|
||||
|
||||
export {
|
||||
GraphQLUpload,
|
||||
GraphQLOptions,
|
||||
GraphQLExtension,
|
||||
gql,
|
||||
Config,
|
||||
} from 'apollo-server-core';
|
||||
|
||||
export { CorsOptions } from 'apollo-server-express';
|
||||
|
||||
export * from './exports';
|
||||
|
||||
export interface ServerInfo {
|
||||
|
|
Loading…
Add table
Reference in a new issue