apollo-server-core
- Version 3.13.0
- Published
- 963 kB
- 23 dependencies
- MIT license
Install
npm i apollo-server-coreyarn add apollo-server-corepnpm add apollo-server-coreOverview
Core engine for Apollo GraphQL server
Index
Functions
- ApolloServerPluginCacheControl()
- ApolloServerPluginCacheControlDisabled()
- ApolloServerPluginDrainHttpServer()
- ApolloServerPluginInlineTrace()
- ApolloServerPluginInlineTraceDisabled()
- ApolloServerPluginLandingPageDisabled()
- ApolloServerPluginLandingPageGraphQLPlayground()
- ApolloServerPluginLandingPageLocalDefault()
- ApolloServerPluginLandingPageProductionDefault()
- ApolloServerPluginSchemaReporting()
- ApolloServerPluginUsageReporting()
- ApolloServerPluginUsageReportingDisabled()
- convertNodeHttpToRequest()
- gql()
- isHttpQueryError()
- resolveGraphqlOptions()
- runHttpQuery()
Classes
Interfaces
ApolloServerPluginUsageReportingOptions
- calculateSignature
- debugPrintReports
- endpointUrl
- experimental_sendOperationAsTrace
- fetcher
- fieldLevelInstrumentation
- generateClientInfo
- includeRequest
- internal_includeTracesContributingToStats
- logger
- maxAttempts
- maxUncompressedReportSize
- minimumRetryDelayMs
- overrideReportedSchema
- reportErrorFunction
- reportIntervalMs
- requestAgent
- requestTimeoutMs
- rewriteError
- sendHeaders
- sendReportsImmediately
- sendUnexecutableOperationDocuments
- sendVariableValues
Type Aliases
- ApolloServerPluginLandingPageGraphQLPlaygroundOptions
- ApolloServerPluginLandingPageLocalDefaultOptions
- ApolloServerPluginLandingPageProductionDefaultOptions
- Context
- ContextFunction
- DocumentStore
- GenerateClientInfo
- GraphQLServiceConfig
- PluginDefinition
- SchemaChangeCallback
- SendValuesBaseOptions
- Unsubscriber
- VariableValueOptions
Functions
function ApolloServerPluginCacheControl
ApolloServerPluginCacheControl: ( options?: ApolloServerPluginCacheControlOptions) => ApolloServerPlugin;function ApolloServerPluginCacheControlDisabled
ApolloServerPluginCacheControlDisabled: () => ApolloServerPlugin;function ApolloServerPluginDrainHttpServer
ApolloServerPluginDrainHttpServer: ( options: ApolloServerPluginDrainHttpServerOptions) => ApolloServerPlugin;function ApolloServerPluginInlineTrace
ApolloServerPluginInlineTrace: ( options?: ApolloServerPluginInlineTraceOptions) => ApolloServerPlugin;function ApolloServerPluginInlineTraceDisabled
ApolloServerPluginInlineTraceDisabled: () => ApolloServerPlugin;function ApolloServerPluginLandingPageDisabled
ApolloServerPluginLandingPageDisabled: () => ApolloServerPlugin;function ApolloServerPluginLandingPageGraphQLPlayground
ApolloServerPluginLandingPageGraphQLPlayground: ( options?: ApolloServerPluginLandingPageGraphQLPlaygroundOptions) => ApolloServerPlugin;function ApolloServerPluginLandingPageLocalDefault
ApolloServerPluginLandingPageLocalDefault: ( options?: ApolloServerPluginLandingPageLocalDefaultOptions) => ApolloServerPlugin;function ApolloServerPluginLandingPageProductionDefault
ApolloServerPluginLandingPageProductionDefault: ( options?: ApolloServerPluginLandingPageProductionDefaultOptions) => ApolloServerPlugin;function ApolloServerPluginSchemaReporting
ApolloServerPluginSchemaReporting: ( options?: ApolloServerPluginSchemaReportingOptions) => ApolloServerPlugin;function ApolloServerPluginUsageReporting
ApolloServerPluginUsageReporting: <TContext>( options?: ApolloServerPluginUsageReportingOptions<TContext>) => ApolloServerPlugin;function ApolloServerPluginUsageReportingDisabled
ApolloServerPluginUsageReportingDisabled: () => ApolloServerPlugin;function convertNodeHttpToRequest
convertNodeHttpToRequest: (req: IncomingMessage) => Request;function gql
gql: ( template: TemplateStringsArray | string, ...substitutions: any[]) => DocumentNode;function isHttpQueryError
isHttpQueryError: (e: unknown) => e is HttpQueryError;function resolveGraphqlOptions
resolveGraphqlOptions: ( options: | GraphQLServerOptions<Record<string, any>, any> | (( ...args: Array<any> ) => ValueOrPromise<GraphQLServerOptions<Record<string, any>, any>>), ...args: Array<any>) => Promise<GraphQLServerOptions>;function runHttpQuery
runHttpQuery: ( handlerArguments: Array<any>, request: HttpQueryRequest, csrfPreventionRequestHeaders?: string[] | null) => Promise<HttpQueryResponse>;Classes
class ApolloServerBase
class ApolloServerBase<ContextFunctionParams = any> {}constructor
constructor(config: Config<ContextFunctionParams>);property csrfPreventionRequestHeaders
protected csrfPreventionRequestHeaders: string[];property graphqlPath
graphqlPath: string;property plugins
protected plugins: ApolloServerPlugin[];property requestOptions
requestOptions: Partial<GraphQLServerOptions<any, any>>;method assertStarted
protected assertStarted: (methodName: string) => void;method ensureStarted
protected ensureStarted: () => Promise<void>;method executeOperation
executeOperation: ( request: Omit<GraphQLRequest, 'query'> & { query?: string | DocumentNode }, integrationContextArgument?: ContextFunctionParams) => Promise<import('apollo-server-types').GraphQLResponse>;method getLandingPage
protected getLandingPage: () => LandingPage | null;method graphQLServerOptions
protected graphQLServerOptions: ( integrationContextArgument?: any) => Promise<GraphQLServerOptions>;method serverlessFramework
protected serverlessFramework: () => boolean;method start
start: () => Promise<void>;method stop
stop: () => Promise<void>;class HttpQueryError
class HttpQueryError extends Error {}constructor
constructor( statusCode: number, message: string, isGraphQLError?: boolean, headers?: { [key: string]: string });property headers
headers?: { [key: string]: string };property isGraphQLError
isGraphQLError: boolean;property statusCode
statusCode: number;Interfaces
interface ApolloServerPluginCacheControlOptions
interface ApolloServerPluginCacheControlOptions {}property calculateHttpHeaders
calculateHttpHeaders?: boolean;property defaultMaxAge
defaultMaxAge?: number;interface ApolloServerPluginDrainHttpServerOptions
interface ApolloServerPluginDrainHttpServerOptions {}property httpServer
httpServer: http.Server;property stopGracePeriodMillis
stopGracePeriodMillis?: number;interface ApolloServerPluginInlineTraceOptions
interface ApolloServerPluginInlineTraceOptions {}property rewriteError
rewriteError?: ApolloServerPluginUsageReportingOptions<never>['rewriteError'];interface ApolloServerPluginLandingPageDefaultBaseOptions
interface ApolloServerPluginLandingPageDefaultBaseOptions {}interface ApolloServerPluginSchemaReportingOptions
interface ApolloServerPluginSchemaReportingOptions {}property endpointUrl
endpointUrl?: string;property fetcher
fetcher?: typeof fetch;property initialDelayMaxMs
initialDelayMaxMs?: number;property overrideReportedSchema
overrideReportedSchema?: string;interface ApolloServerPluginUsageReportingOptions
interface ApolloServerPluginUsageReportingOptions<TContext> {}property calculateSignature
calculateSignature?: (ast: DocumentNode, operationName: string) => string;property debugPrintReports
debugPrintReports?: boolean;property endpointUrl
endpointUrl?: string;property experimental_sendOperationAsTrace
experimental_sendOperationAsTrace?: ( trace: Trace, statsReportKey: string) => boolean;property fetcher
fetcher?: typeof fetch;property fieldLevelInstrumentation
fieldLevelInstrumentation?: | number | (( request: GraphQLRequestContextDidResolveOperation<TContext> ) => Promise<number | boolean>);property generateClientInfo
generateClientInfo?: GenerateClientInfo<TContext>;property includeRequest
includeRequest?: ( request: | GraphQLRequestContextDidResolveOperation<TContext> | GraphQLRequestContextWillSendResponse<TContext>) => Promise<boolean>;property internal_includeTracesContributingToStats
internal_includeTracesContributingToStats?: boolean;property logger
logger?: Logger;property maxAttempts
maxAttempts?: number;property maxUncompressedReportSize
maxUncompressedReportSize?: number;property minimumRetryDelayMs
minimumRetryDelayMs?: number;property overrideReportedSchema
overrideReportedSchema?: string;property reportErrorFunction
reportErrorFunction?: (err: Error) => void;property reportIntervalMs
reportIntervalMs?: number;property requestAgent
requestAgent?: RequestAgent | false;property requestTimeoutMs
requestTimeoutMs?: number;property rewriteError
rewriteError?: (err: GraphQLError) => GraphQLError | null;property sendHeaders
sendHeaders?: SendValuesBaseOptions;property sendReportsImmediately
sendReportsImmediately?: boolean;property sendUnexecutableOperationDocuments
sendUnexecutableOperationDocuments?: boolean;property sendVariableValues
sendVariableValues?: VariableValueOptions;interface ClientInfo
interface ClientInfo {}property clientName
clientName?: string;property clientVersion
clientVersion?: string;interface Config
interface Config<ContextFunctionParams = any> extends BaseConfig {}property apollo
apollo?: ApolloConfigInput;property cache
cache?: KeyValueCache | 'bounded';property context
context?: Context | ContextFunction<ContextFunctionParams>;property csrfPrevention
csrfPrevention?: CSRFPreventionOptions | boolean;property dangerouslyDisableValidation
dangerouslyDisableValidation?: boolean;property documentStore
documentStore?: DocumentStore | null;property gateway
gateway?: GatewayInterface;property introspection
introspection?: boolean;property mockEntireSchema
mockEntireSchema?: boolean;property mocks
mocks?: boolean | IMocks;property modules
modules?: GraphQLSchemaModule[];property nodeEnv
nodeEnv?: string;property parseOptions
parseOptions?: IExecutableSchemaDefinition['parseOptions'];property persistedQueries
persistedQueries?: PersistedQueryOptions | false;property plugins
plugins?: PluginDefinition[];property resolvers
resolvers?: IExecutableSchemaDefinition['resolvers'];property schema
schema?: GraphQLSchema;property stopOnTerminationSignals
stopOnTerminationSignals?: boolean;property typeDefs
typeDefs?: IExecutableSchemaDefinition['typeDefs'];interface CSRFPreventionOptions
interface CSRFPreventionOptions {}property requestHeaders
requestHeaders?: string[];interface GatewayInterface
interface GatewayInterface {}method load
load: (options: { apollo: ApolloConfig }) => Promise<GraphQLServiceConfig>;method onSchemaChange
onSchemaChange: (callback: SchemaChangeCallback) => Unsubscriber;method onSchemaLoadOrUpdate
onSchemaLoadOrUpdate: ( callback: (schemaContext: { apiSchema: GraphQLSchema; coreSupergraphSdl: string; }) => void) => Unsubscriber;method stop
stop: () => Promise<void>;interface GraphQLOptions
interface GraphQLServerOptions<TContext = Record<string, any>, TRootValue = any> {}property allowBatchedHttpRequests
allowBatchedHttpRequests?: boolean;property cache
cache?: KeyValueCache;property context
context?: TContext | (() => never);property dangerouslyDisableValidation
dangerouslyDisableValidation?: boolean;property dataSources
dataSources?: () => DataSources<TContext>;property debug
debug?: boolean;property documentStore
documentStore?: DocumentStore | null;property executor
executor?: GraphQLExecutor;property fieldResolver
fieldResolver?: GraphQLFieldResolver<any, TContext>;property formatError
formatError?: (error: GraphQLError) => GraphQLFormattedError;property formatResponse
formatResponse?: ( response: GraphQLResponse, requestContext: GraphQLRequestContext<TContext>) => GraphQLResponse | null;property logger
logger?: Logger;property nodeEnv
nodeEnv?: string;property parseOptions
parseOptions?: ParseOptions;property persistedQueries
persistedQueries?: PersistedQueryOptions;property plugins
plugins?: ApolloServerPlugin[];property rootValue
rootValue?: ((parsedQuery: DocumentNode) => TRootValue) | TRootValue;property schema
schema: GraphQLSchema;property schemaHash
schemaHash: SchemaHash;property validationRules
validationRules?: Array<(context: ValidationContext) => any>;interface GraphQLService
interface GraphQLService extends GatewayInterface {}interface HttpQueryRequest
interface HttpQueryRequest {}interface PersistedQueryOptions
interface PersistedQueryOptions {}Type Aliases
type ApolloServerPluginLandingPageGraphQLPlaygroundOptions
type ApolloServerPluginLandingPageGraphQLPlaygroundOptions = Parameters< typeof renderPlaygroundPage>[0];type ApolloServerPluginLandingPageLocalDefaultOptions
type ApolloServerPluginLandingPageLocalDefaultOptions = | ApolloServerPluginEmbeddedLandingPageLocalDefaultOptions | ApolloServerPluginNonEmbeddedLandingPageLocalDefaultOptions;type ApolloServerPluginLandingPageProductionDefaultOptions
type ApolloServerPluginLandingPageProductionDefaultOptions = | ApolloServerPluginEmbeddedLandingPageProductionDefaultOptions | ApolloServerPluginNonEmbeddedLandingPageProductionDefaultOptions;type Context
type Context<T = object> = T;type ContextFunction
type ContextFunction<FunctionParams = any, ProducedContext = object> = ( context: FunctionParams) => ValueOrPromise<Context<ProducedContext>>;type DocumentStore
type DocumentStore = KeyValueCache<DocumentNode>;type GenerateClientInfo
type GenerateClientInfo<TContext> = ( requestContext: GraphQLRequestContext<TContext>) => ClientInfo;type GraphQLServiceConfig
type GraphQLServiceConfig = { schema: GraphQLSchema; executor: GraphQLExecutor | null;};type PluginDefinition
type PluginDefinition = ApolloServerPlugin | (() => ApolloServerPlugin);type SchemaChangeCallback
type SchemaChangeCallback = (apiSchema: GraphQLSchema) => void;type SendValuesBaseOptions
type SendValuesBaseOptions = | { onlyNames: Array<String>; } | { exceptNames: Array<String>; } | { all: true; } | { none: true; };type Unsubscriber
type Unsubscriber = () => void;type VariableValueOptions
type VariableValueOptions = | { transform: (options: VariableValueTransformOptions) => Record<string, any>; } | SendValuesBaseOptions;Package Files (15)
- dist/ApolloServer.d.ts
- dist/gql.d.ts
- dist/graphqlOptions.d.ts
- dist/index.d.ts
- dist/nodeHttpToRequest.d.ts
- dist/plugin/cacheControl/index.d.ts
- dist/plugin/drainHttpServer/index.d.ts
- dist/plugin/index.d.ts
- dist/plugin/inlineTrace/index.d.ts
- dist/plugin/landingPage/default/types.d.ts
- dist/plugin/landingPage/graphqlPlayground/index.d.ts
- dist/plugin/schemaReporting/index.d.ts
- dist/plugin/usageReporting/options.d.ts
- dist/runHttpQuery.d.ts
- dist/types.d.ts
Dependencies (23)
- @apollo/utils.keyvaluecache
- @apollo/utils.logger
- @apollo/utils.usagereporting
- @apollographql/apollo-tools
- @apollographql/graphql-playground-html
- @graphql-tools/mock
- @graphql-tools/schema
- @josephg/resolvable
- apollo-datasource
- apollo-reporting-protobuf
- apollo-server-env
- apollo-server-errors
- apollo-server-plugin-base
- apollo-server-types
- async-retry
- fast-json-stable-stringify
- graphql-tag
- loglevel
- lru-cache
- node-abort-controller
- sha.js
- uuid
- whatwg-mimetype
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/apollo-server-core.
- Markdown[](https://www.jsdocs.io/package/apollo-server-core)
- HTML<a href="https://www.jsdocs.io/package/apollo-server-core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 6639 ms. - Missing or incorrect documentation? Open an issue for this package.
