@depup/apollo__server 5.5.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/changes.json +46 -0
- package/dist/cjs/ApolloServer.d.ts +126 -0
- package/dist/cjs/ApolloServer.d.ts.map +1 -0
- package/dist/cjs/ApolloServer.js +726 -0
- package/dist/cjs/ApolloServer.js.map +1 -0
- package/dist/cjs/cachePolicy.d.ts +3 -0
- package/dist/cjs/cachePolicy.d.ts.map +1 -0
- package/dist/cjs/cachePolicy.js +33 -0
- package/dist/cjs/cachePolicy.js.map +1 -0
- package/dist/cjs/determineApolloConfig.d.ts +4 -0
- package/dist/cjs/determineApolloConfig.d.ts.map +1 -0
- package/dist/cjs/determineApolloConfig.js +58 -0
- package/dist/cjs/determineApolloConfig.js.map +1 -0
- package/dist/cjs/errorNormalize.d.ts +12 -0
- package/dist/cjs/errorNormalize.d.ts.map +1 -0
- package/dist/cjs/errorNormalize.js +71 -0
- package/dist/cjs/errorNormalize.js.map +1 -0
- package/dist/cjs/errors/index.d.ts +16 -0
- package/dist/cjs/errors/index.d.ts.map +1 -0
- package/dist/cjs/errors/index.js +28 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/externalTypes/constructor.d.ts +78 -0
- package/dist/cjs/externalTypes/constructor.d.ts.map +1 -0
- package/dist/cjs/externalTypes/constructor.js +3 -0
- package/dist/cjs/externalTypes/constructor.js.map +1 -0
- package/dist/cjs/externalTypes/context.d.ts +4 -0
- package/dist/cjs/externalTypes/context.d.ts.map +1 -0
- package/dist/cjs/externalTypes/context.js +3 -0
- package/dist/cjs/externalTypes/context.js.map +1 -0
- package/dist/cjs/externalTypes/graphql.d.ts +41 -0
- package/dist/cjs/externalTypes/graphql.d.ts.map +1 -0
- package/dist/cjs/externalTypes/graphql.js +3 -0
- package/dist/cjs/externalTypes/graphql.js.map +1 -0
- package/dist/cjs/externalTypes/http.d.ts +22 -0
- package/dist/cjs/externalTypes/http.d.ts.map +1 -0
- package/dist/cjs/externalTypes/http.js +3 -0
- package/dist/cjs/externalTypes/http.js.map +1 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts +28 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map +1 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js +3 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map +1 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts +43 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map +1 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js +3 -0
- package/dist/cjs/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map +1 -0
- package/dist/cjs/externalTypes/index.d.ts +9 -0
- package/dist/cjs/externalTypes/index.d.ts.map +1 -0
- package/dist/cjs/externalTypes/index.js +3 -0
- package/dist/cjs/externalTypes/index.js.map +1 -0
- package/dist/cjs/externalTypes/plugins.d.ts +75 -0
- package/dist/cjs/externalTypes/plugins.d.ts.map +1 -0
- package/dist/cjs/externalTypes/plugins.js +3 -0
- package/dist/cjs/externalTypes/plugins.js.map +1 -0
- package/dist/cjs/externalTypes/requestPipeline.d.ts +50 -0
- package/dist/cjs/externalTypes/requestPipeline.d.ts.map +1 -0
- package/dist/cjs/externalTypes/requestPipeline.js +3 -0
- package/dist/cjs/externalTypes/requestPipeline.js.map +1 -0
- package/dist/cjs/generated/packageVersion.d.ts +2 -0
- package/dist/cjs/generated/packageVersion.d.ts.map +1 -0
- package/dist/cjs/generated/packageVersion.js +5 -0
- package/dist/cjs/generated/packageVersion.js.map +1 -0
- package/dist/cjs/httpBatching.d.ts +4 -0
- package/dist/cjs/httpBatching.d.ts.map +1 -0
- package/dist/cjs/httpBatching.js +58 -0
- package/dist/cjs/httpBatching.js.map +1 -0
- package/dist/cjs/incrementalDeliveryPolyfill.d.ts +82 -0
- package/dist/cjs/incrementalDeliveryPolyfill.d.ts.map +1 -0
- package/dist/cjs/incrementalDeliveryPolyfill.js +74 -0
- package/dist/cjs/incrementalDeliveryPolyfill.js.map +1 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +23 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/internalErrorClasses.d.ts +28 -0
- package/dist/cjs/internalErrorClasses.d.ts.map +1 -0
- package/dist/cjs/internalErrorClasses.js +91 -0
- package/dist/cjs/internalErrorClasses.js.map +1 -0
- package/dist/cjs/internalPlugin.d.ts +9 -0
- package/dist/cjs/internalPlugin.d.ts.map +1 -0
- package/dist/cjs/internalPlugin.js +11 -0
- package/dist/cjs/internalPlugin.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/plugin/cacheControl/index.d.ts +9 -0
- package/dist/cjs/plugin/cacheControl/index.d.ts.map +1 -0
- package/dist/cjs/plugin/cacheControl/index.js +223 -0
- package/dist/cjs/plugin/cacheControl/index.js.map +1 -0
- package/dist/cjs/plugin/disableSuggestions/index.d.ts +3 -0
- package/dist/cjs/plugin/disableSuggestions/index.d.ts.map +1 -0
- package/dist/cjs/plugin/disableSuggestions/index.js +22 -0
- package/dist/cjs/plugin/disableSuggestions/index.js.map +1 -0
- package/dist/cjs/plugin/disabled/index.d.ts +7 -0
- package/dist/cjs/plugin/disabled/index.d.ts.map +1 -0
- package/dist/cjs/plugin/disabled/index.js +30 -0
- package/dist/cjs/plugin/disabled/index.js.map +1 -0
- package/dist/cjs/plugin/drainHttpServer/index.d.ts +8 -0
- package/dist/cjs/plugin/drainHttpServer/index.d.ts.map +1 -0
- package/dist/cjs/plugin/drainHttpServer/index.js +19 -0
- package/dist/cjs/plugin/drainHttpServer/index.js.map +1 -0
- package/dist/cjs/plugin/drainHttpServer/stoppable.d.ts +10 -0
- package/dist/cjs/plugin/drainHttpServer/stoppable.d.ts.map +1 -0
- package/dist/cjs/plugin/drainHttpServer/stoppable.js +54 -0
- package/dist/cjs/plugin/drainHttpServer/stoppable.js.map +1 -0
- package/dist/cjs/plugin/inlineTrace/index.d.ts +8 -0
- package/dist/cjs/plugin/inlineTrace/index.d.ts.map +1 -0
- package/dist/cjs/plugin/inlineTrace/index.js +70 -0
- package/dist/cjs/plugin/inlineTrace/index.js.map +1 -0
- package/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts +4 -0
- package/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.d.ts.map +1 -0
- package/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js +143 -0
- package/dist/cjs/plugin/landingPage/default/getEmbeddedHTML.js.map +1 -0
- package/dist/cjs/plugin/landingPage/default/index.d.ts +9 -0
- package/dist/cjs/plugin/landingPage/default/index.d.ts.map +1 -0
- package/dist/cjs/plugin/landingPage/default/index.js +146 -0
- package/dist/cjs/plugin/landingPage/default/index.js.map +1 -0
- package/dist/cjs/plugin/landingPage/default/types.d.ts +56 -0
- package/dist/cjs/plugin/landingPage/default/types.d.ts.map +1 -0
- package/dist/cjs/plugin/landingPage/default/types.js +3 -0
- package/dist/cjs/plugin/landingPage/default/types.js.map +1 -0
- package/dist/cjs/plugin/schemaIsSubgraph.d.ts +3 -0
- package/dist/cjs/plugin/schemaIsSubgraph.d.ts.map +1 -0
- package/dist/cjs/plugin/schemaIsSubgraph.js +23 -0
- package/dist/cjs/plugin/schemaIsSubgraph.js.map +1 -0
- package/dist/cjs/plugin/schemaReporting/index.d.ts +10 -0
- package/dist/cjs/plugin/schemaReporting/index.d.ts.map +1 -0
- package/dist/cjs/plugin/schemaReporting/index.js +104 -0
- package/dist/cjs/plugin/schemaReporting/index.js.map +1 -0
- package/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts +33 -0
- package/dist/cjs/plugin/schemaReporting/schemaReporter.d.ts.map +1 -0
- package/dist/cjs/plugin/schemaReporting/schemaReporter.js +147 -0
- package/dist/cjs/plugin/schemaReporting/schemaReporter.js.map +1 -0
- package/dist/cjs/plugin/subscriptionCallback/index.d.ts +12 -0
- package/dist/cjs/plugin/subscriptionCallback/index.d.ts.map +1 -0
- package/dist/cjs/plugin/subscriptionCallback/index.js +434 -0
- package/dist/cjs/plugin/subscriptionCallback/index.js.map +1 -0
- package/dist/cjs/plugin/traceTreeBuilder.d.ts +25 -0
- package/dist/cjs/plugin/traceTreeBuilder.d.ts.map +1 -0
- package/dist/cjs/plugin/traceTreeBuilder.js +201 -0
- package/dist/cjs/plugin/traceTreeBuilder.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts +3 -0
- package/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js +44 -0
- package/dist/cjs/plugin/usageReporting/defaultSendOperationsAsTrace.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/durationHistogram.d.ts +16 -0
- package/dist/cjs/plugin/usageReporting/durationHistogram.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/durationHistogram.js +68 -0
- package/dist/cjs/plugin/usageReporting/durationHistogram.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/index.d.ts +3 -0
- package/dist/cjs/plugin/usageReporting/index.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/index.js +6 -0
- package/dist/cjs/plugin/usageReporting/index.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts +7 -0
- package/dist/cjs/plugin/usageReporting/iterateOverTrace.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/iterateOverTrace.js +81 -0
- package/dist/cjs/plugin/usageReporting/iterateOverTrace.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts +12 -0
- package/dist/cjs/plugin/usageReporting/operationDerivedDataCache.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js +33 -0
- package/dist/cjs/plugin/usageReporting/operationDerivedDataCache.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/options.d.ts +60 -0
- package/dist/cjs/plugin/usageReporting/options.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/options.js +3 -0
- package/dist/cjs/plugin/usageReporting/options.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/plugin.d.ts +7 -0
- package/dist/cjs/plugin/usageReporting/plugin.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/plugin.js +494 -0
- package/dist/cjs/plugin/usageReporting/plugin.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/stats.d.ts +96 -0
- package/dist/cjs/plugin/usageReporting/stats.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/stats.js +289 -0
- package/dist/cjs/plugin/usageReporting/stats.js.map +1 -0
- package/dist/cjs/plugin/usageReporting/traceDetails.d.ts +4 -0
- package/dist/cjs/plugin/usageReporting/traceDetails.d.ts.map +1 -0
- package/dist/cjs/plugin/usageReporting/traceDetails.js +63 -0
- package/dist/cjs/plugin/usageReporting/traceDetails.js.map +1 -0
- package/dist/cjs/preventCsrf.d.ts +4 -0
- package/dist/cjs/preventCsrf.d.ts.map +1 -0
- package/dist/cjs/preventCsrf.js +41 -0
- package/dist/cjs/preventCsrf.js.map +1 -0
- package/dist/cjs/requestPipeline.d.ts +9 -0
- package/dist/cjs/requestPipeline.d.ts.map +1 -0
- package/dist/cjs/requestPipeline.js +371 -0
- package/dist/cjs/requestPipeline.js.map +1 -0
- package/dist/cjs/runHttpQuery.d.ts +15 -0
- package/dist/cjs/runHttpQuery.d.ts.map +1 -0
- package/dist/cjs/runHttpQuery.js +230 -0
- package/dist/cjs/runHttpQuery.js.map +1 -0
- package/dist/cjs/standalone/index.d.ts +25 -0
- package/dist/cjs/standalone/index.d.ts.map +1 -0
- package/dist/cjs/standalone/index.js +97 -0
- package/dist/cjs/standalone/index.js.map +1 -0
- package/dist/cjs/utils/HeaderMap.d.ts +8 -0
- package/dist/cjs/utils/HeaderMap.d.ts.map +1 -0
- package/dist/cjs/utils/HeaderMap.js +20 -0
- package/dist/cjs/utils/HeaderMap.js.map +1 -0
- package/dist/cjs/utils/UnreachableCaseError.d.ts +4 -0
- package/dist/cjs/utils/UnreachableCaseError.d.ts.map +1 -0
- package/dist/cjs/utils/UnreachableCaseError.js +10 -0
- package/dist/cjs/utils/UnreachableCaseError.js.map +1 -0
- package/dist/cjs/utils/computeCoreSchemaHash.d.ts +2 -0
- package/dist/cjs/utils/computeCoreSchemaHash.d.ts.map +1 -0
- package/dist/cjs/utils/computeCoreSchemaHash.js +8 -0
- package/dist/cjs/utils/computeCoreSchemaHash.js.map +1 -0
- package/dist/cjs/utils/invokeHooks.d.ts +7 -0
- package/dist/cjs/utils/invokeHooks.d.ts.map +1 -0
- package/dist/cjs/utils/invokeHooks.js +36 -0
- package/dist/cjs/utils/invokeHooks.js.map +1 -0
- package/dist/cjs/utils/isDefined.d.ts +2 -0
- package/dist/cjs/utils/isDefined.d.ts.map +1 -0
- package/dist/cjs/utils/isDefined.js +7 -0
- package/dist/cjs/utils/isDefined.js.map +1 -0
- package/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts +5 -0
- package/dist/cjs/utils/makeGatewayGraphQLRequestContext.d.ts.map +1 -0
- package/dist/cjs/utils/makeGatewayGraphQLRequestContext.js +96 -0
- package/dist/cjs/utils/makeGatewayGraphQLRequestContext.js.map +1 -0
- package/dist/cjs/utils/resolvable.d.ts +7 -0
- package/dist/cjs/utils/resolvable.d.ts.map +1 -0
- package/dist/cjs/utils/resolvable.js +14 -0
- package/dist/cjs/utils/resolvable.js.map +1 -0
- package/dist/cjs/utils/schemaInstrumentation.d.ts +16 -0
- package/dist/cjs/utils/schemaInstrumentation.d.ts.map +1 -0
- package/dist/cjs/utils/schemaInstrumentation.js +75 -0
- package/dist/cjs/utils/schemaInstrumentation.js.map +1 -0
- package/dist/cjs/utils/schemaManager.d.ts +31 -0
- package/dist/cjs/utils/schemaManager.d.ts.map +1 -0
- package/dist/cjs/utils/schemaManager.js +103 -0
- package/dist/cjs/utils/schemaManager.js.map +1 -0
- package/dist/cjs/utils/urlForHttpServer.d.ts +3 -0
- package/dist/cjs/utils/urlForHttpServer.d.ts.map +1 -0
- package/dist/cjs/utils/urlForHttpServer.js +15 -0
- package/dist/cjs/utils/urlForHttpServer.js.map +1 -0
- package/dist/cjs/validationRules/NoIntrospection.d.ts +3 -0
- package/dist/cjs/validationRules/NoIntrospection.d.ts.map +1 -0
- package/dist/cjs/validationRules/NoIntrospection.js +19 -0
- package/dist/cjs/validationRules/NoIntrospection.js.map +1 -0
- package/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts +4 -0
- package/dist/cjs/validationRules/RecursiveSelectionsLimit.d.ts.map +1 -0
- package/dist/cjs/validationRules/RecursiveSelectionsLimit.js +150 -0
- package/dist/cjs/validationRules/RecursiveSelectionsLimit.js.map +1 -0
- package/dist/cjs/validationRules/index.d.ts +3 -0
- package/dist/cjs/validationRules/index.d.ts.map +1 -0
- package/dist/cjs/validationRules/index.js +9 -0
- package/dist/cjs/validationRules/index.js.map +1 -0
- package/dist/esm/ApolloServer.d.ts +126 -0
- package/dist/esm/ApolloServer.d.ts.map +1 -0
- package/dist/esm/ApolloServer.js +683 -0
- package/dist/esm/ApolloServer.js.map +1 -0
- package/dist/esm/cachePolicy.d.ts +3 -0
- package/dist/esm/cachePolicy.d.ts.map +1 -0
- package/dist/esm/cachePolicy.js +30 -0
- package/dist/esm/cachePolicy.js.map +1 -0
- package/dist/esm/determineApolloConfig.d.ts +4 -0
- package/dist/esm/determineApolloConfig.d.ts.map +1 -0
- package/dist/esm/determineApolloConfig.js +55 -0
- package/dist/esm/determineApolloConfig.js.map +1 -0
- package/dist/esm/errorNormalize.d.ts +12 -0
- package/dist/esm/errorNormalize.d.ts.map +1 -0
- package/dist/esm/errorNormalize.js +66 -0
- package/dist/esm/errorNormalize.js.map +1 -0
- package/dist/esm/errors/index.d.ts +16 -0
- package/dist/esm/errors/index.d.ts.map +1 -0
- package/dist/esm/errors/index.js +24 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/externalTypes/constructor.d.ts +78 -0
- package/dist/esm/externalTypes/constructor.d.ts.map +1 -0
- package/dist/esm/externalTypes/constructor.js +2 -0
- package/dist/esm/externalTypes/constructor.js.map +1 -0
- package/dist/esm/externalTypes/context.d.ts +4 -0
- package/dist/esm/externalTypes/context.d.ts.map +1 -0
- package/dist/esm/externalTypes/context.js +2 -0
- package/dist/esm/externalTypes/context.js.map +1 -0
- package/dist/esm/externalTypes/graphql.d.ts +41 -0
- package/dist/esm/externalTypes/graphql.d.ts.map +1 -0
- package/dist/esm/externalTypes/graphql.js +2 -0
- package/dist/esm/externalTypes/graphql.js.map +1 -0
- package/dist/esm/externalTypes/http.d.ts +22 -0
- package/dist/esm/externalTypes/http.d.ts.map +1 -0
- package/dist/esm/externalTypes/http.js +2 -0
- package/dist/esm/externalTypes/http.js.map +1 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts +28 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.d.ts.map +1 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js +2 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha2.js.map +1 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts +43 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.d.ts.map +1 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js +2 -0
- package/dist/esm/externalTypes/incrementalDeliveryPolyfillAlpha9.js.map +1 -0
- package/dist/esm/externalTypes/index.d.ts +9 -0
- package/dist/esm/externalTypes/index.d.ts.map +1 -0
- package/dist/esm/externalTypes/index.js +2 -0
- package/dist/esm/externalTypes/index.js.map +1 -0
- package/dist/esm/externalTypes/plugins.d.ts +75 -0
- package/dist/esm/externalTypes/plugins.d.ts.map +1 -0
- package/dist/esm/externalTypes/plugins.js +2 -0
- package/dist/esm/externalTypes/plugins.js.map +1 -0
- package/dist/esm/externalTypes/requestPipeline.d.ts +50 -0
- package/dist/esm/externalTypes/requestPipeline.d.ts.map +1 -0
- package/dist/esm/externalTypes/requestPipeline.js +2 -0
- package/dist/esm/externalTypes/requestPipeline.js.map +1 -0
- package/dist/esm/generated/packageVersion.d.ts +2 -0
- package/dist/esm/generated/packageVersion.d.ts.map +1 -0
- package/dist/esm/generated/packageVersion.js +2 -0
- package/dist/esm/generated/packageVersion.js.map +1 -0
- package/dist/esm/httpBatching.d.ts +4 -0
- package/dist/esm/httpBatching.d.ts.map +1 -0
- package/dist/esm/httpBatching.js +55 -0
- package/dist/esm/httpBatching.js.map +1 -0
- package/dist/esm/incrementalDeliveryPolyfill.d.ts +82 -0
- package/dist/esm/incrementalDeliveryPolyfill.d.ts.map +1 -0
- package/dist/esm/incrementalDeliveryPolyfill.js +38 -0
- package/dist/esm/incrementalDeliveryPolyfill.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internalErrorClasses.d.ts +28 -0
- package/dist/esm/internalErrorClasses.d.ts.map +1 -0
- package/dist/esm/internalErrorClasses.js +81 -0
- package/dist/esm/internalErrorClasses.js.map +1 -0
- package/dist/esm/internalPlugin.d.ts +9 -0
- package/dist/esm/internalPlugin.d.ts.map +1 -0
- package/dist/esm/internalPlugin.js +7 -0
- package/dist/esm/internalPlugin.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/plugin/cacheControl/index.d.ts +9 -0
- package/dist/esm/plugin/cacheControl/index.d.ts.map +1 -0
- package/dist/esm/plugin/cacheControl/index.js +220 -0
- package/dist/esm/plugin/cacheControl/index.js.map +1 -0
- package/dist/esm/plugin/disableSuggestions/index.d.ts +3 -0
- package/dist/esm/plugin/disableSuggestions/index.d.ts.map +1 -0
- package/dist/esm/plugin/disableSuggestions/index.js +19 -0
- package/dist/esm/plugin/disableSuggestions/index.js.map +1 -0
- package/dist/esm/plugin/disabled/index.d.ts +7 -0
- package/dist/esm/plugin/disabled/index.d.ts.map +1 -0
- package/dist/esm/plugin/disabled/index.js +23 -0
- package/dist/esm/plugin/disabled/index.js.map +1 -0
- package/dist/esm/plugin/drainHttpServer/index.d.ts +8 -0
- package/dist/esm/plugin/drainHttpServer/index.d.ts.map +1 -0
- package/dist/esm/plugin/drainHttpServer/index.js +16 -0
- package/dist/esm/plugin/drainHttpServer/index.js.map +1 -0
- package/dist/esm/plugin/drainHttpServer/stoppable.d.ts +10 -0
- package/dist/esm/plugin/drainHttpServer/stoppable.d.ts.map +1 -0
- package/dist/esm/plugin/drainHttpServer/stoppable.js +47 -0
- package/dist/esm/plugin/drainHttpServer/stoppable.js.map +1 -0
- package/dist/esm/plugin/inlineTrace/index.d.ts +8 -0
- package/dist/esm/plugin/inlineTrace/index.d.ts.map +1 -0
- package/dist/esm/plugin/inlineTrace/index.js +67 -0
- package/dist/esm/plugin/inlineTrace/index.js.map +1 -0
- package/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts +4 -0
- package/dist/esm/plugin/landingPage/default/getEmbeddedHTML.d.ts.map +1 -0
- package/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js +138 -0
- package/dist/esm/plugin/landingPage/default/getEmbeddedHTML.js.map +1 -0
- package/dist/esm/plugin/landingPage/default/index.d.ts +9 -0
- package/dist/esm/plugin/landingPage/default/index.d.ts.map +1 -0
- package/dist/esm/plugin/landingPage/default/index.js +141 -0
- package/dist/esm/plugin/landingPage/default/index.js.map +1 -0
- package/dist/esm/plugin/landingPage/default/types.d.ts +56 -0
- package/dist/esm/plugin/landingPage/default/types.d.ts.map +1 -0
- package/dist/esm/plugin/landingPage/default/types.js +2 -0
- package/dist/esm/plugin/landingPage/default/types.js.map +1 -0
- package/dist/esm/plugin/schemaIsSubgraph.d.ts +3 -0
- package/dist/esm/plugin/schemaIsSubgraph.d.ts.map +1 -0
- package/dist/esm/plugin/schemaIsSubgraph.js +20 -0
- package/dist/esm/plugin/schemaIsSubgraph.js.map +1 -0
- package/dist/esm/plugin/schemaReporting/index.d.ts +10 -0
- package/dist/esm/plugin/schemaReporting/index.d.ts.map +1 -0
- package/dist/esm/plugin/schemaReporting/index.js +98 -0
- package/dist/esm/plugin/schemaReporting/index.js.map +1 -0
- package/dist/esm/plugin/schemaReporting/schemaReporter.d.ts +33 -0
- package/dist/esm/plugin/schemaReporting/schemaReporter.d.ts.map +1 -0
- package/dist/esm/plugin/schemaReporting/schemaReporter.js +143 -0
- package/dist/esm/plugin/schemaReporting/schemaReporter.js.map +1 -0
- package/dist/esm/plugin/subscriptionCallback/index.d.ts +12 -0
- package/dist/esm/plugin/subscriptionCallback/index.d.ts.map +1 -0
- package/dist/esm/plugin/subscriptionCallback/index.js +428 -0
- package/dist/esm/plugin/subscriptionCallback/index.js.map +1 -0
- package/dist/esm/plugin/traceTreeBuilder.d.ts +25 -0
- package/dist/esm/plugin/traceTreeBuilder.d.ts.map +1 -0
- package/dist/esm/plugin/traceTreeBuilder.js +196 -0
- package/dist/esm/plugin/traceTreeBuilder.js.map +1 -0
- package/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts +3 -0
- package/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js +41 -0
- package/dist/esm/plugin/usageReporting/defaultSendOperationsAsTrace.js.map +1 -0
- package/dist/esm/plugin/usageReporting/durationHistogram.d.ts +16 -0
- package/dist/esm/plugin/usageReporting/durationHistogram.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/durationHistogram.js +64 -0
- package/dist/esm/plugin/usageReporting/durationHistogram.js.map +1 -0
- package/dist/esm/plugin/usageReporting/index.d.ts +3 -0
- package/dist/esm/plugin/usageReporting/index.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/index.js +2 -0
- package/dist/esm/plugin/usageReporting/index.js.map +1 -0
- package/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts +7 -0
- package/dist/esm/plugin/usageReporting/iterateOverTrace.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/iterateOverTrace.js +78 -0
- package/dist/esm/plugin/usageReporting/iterateOverTrace.js.map +1 -0
- package/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts +12 -0
- package/dist/esm/plugin/usageReporting/operationDerivedDataCache.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/operationDerivedDataCache.js +29 -0
- package/dist/esm/plugin/usageReporting/operationDerivedDataCache.js.map +1 -0
- package/dist/esm/plugin/usageReporting/options.d.ts +60 -0
- package/dist/esm/plugin/usageReporting/options.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/options.js +2 -0
- package/dist/esm/plugin/usageReporting/options.js.map +1 -0
- package/dist/esm/plugin/usageReporting/plugin.d.ts +7 -0
- package/dist/esm/plugin/usageReporting/plugin.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/plugin.js +487 -0
- package/dist/esm/plugin/usageReporting/plugin.js.map +1 -0
- package/dist/esm/plugin/usageReporting/stats.d.ts +96 -0
- package/dist/esm/plugin/usageReporting/stats.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/stats.js +283 -0
- package/dist/esm/plugin/usageReporting/stats.js.map +1 -0
- package/dist/esm/plugin/usageReporting/traceDetails.d.ts +4 -0
- package/dist/esm/plugin/usageReporting/traceDetails.d.ts.map +1 -0
- package/dist/esm/plugin/usageReporting/traceDetails.js +60 -0
- package/dist/esm/plugin/usageReporting/traceDetails.js.map +1 -0
- package/dist/esm/preventCsrf.d.ts +4 -0
- package/dist/esm/preventCsrf.d.ts.map +1 -0
- package/dist/esm/preventCsrf.js +34 -0
- package/dist/esm/preventCsrf.js.map +1 -0
- package/dist/esm/requestPipeline.d.ts +9 -0
- package/dist/esm/requestPipeline.d.ts.map +1 -0
- package/dist/esm/requestPipeline.js +364 -0
- package/dist/esm/requestPipeline.js.map +1 -0
- package/dist/esm/runHttpQuery.d.ts +15 -0
- package/dist/esm/runHttpQuery.d.ts.map +1 -0
- package/dist/esm/runHttpQuery.js +221 -0
- package/dist/esm/runHttpQuery.js.map +1 -0
- package/dist/esm/standalone/index.d.ts +25 -0
- package/dist/esm/standalone/index.d.ts.map +1 -0
- package/dist/esm/standalone/index.js +91 -0
- package/dist/esm/standalone/index.js.map +1 -0
- package/dist/esm/utils/HeaderMap.d.ts +8 -0
- package/dist/esm/utils/HeaderMap.d.ts.map +1 -0
- package/dist/esm/utils/HeaderMap.js +16 -0
- package/dist/esm/utils/HeaderMap.js.map +1 -0
- package/dist/esm/utils/UnreachableCaseError.d.ts +4 -0
- package/dist/esm/utils/UnreachableCaseError.d.ts.map +1 -0
- package/dist/esm/utils/UnreachableCaseError.js +6 -0
- package/dist/esm/utils/UnreachableCaseError.js.map +1 -0
- package/dist/esm/utils/computeCoreSchemaHash.d.ts +2 -0
- package/dist/esm/utils/computeCoreSchemaHash.d.ts.map +1 -0
- package/dist/esm/utils/computeCoreSchemaHash.js +5 -0
- package/dist/esm/utils/computeCoreSchemaHash.js.map +1 -0
- package/dist/esm/utils/invokeHooks.d.ts +7 -0
- package/dist/esm/utils/invokeHooks.d.ts.map +1 -0
- package/dist/esm/utils/invokeHooks.js +31 -0
- package/dist/esm/utils/invokeHooks.js.map +1 -0
- package/dist/esm/utils/isDefined.d.ts +2 -0
- package/dist/esm/utils/isDefined.d.ts.map +1 -0
- package/dist/esm/utils/isDefined.js +4 -0
- package/dist/esm/utils/isDefined.js.map +1 -0
- package/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts +5 -0
- package/dist/esm/utils/makeGatewayGraphQLRequestContext.d.ts.map +1 -0
- package/dist/esm/utils/makeGatewayGraphQLRequestContext.js +93 -0
- package/dist/esm/utils/makeGatewayGraphQLRequestContext.js.map +1 -0
- package/dist/esm/utils/resolvable.d.ts +7 -0
- package/dist/esm/utils/resolvable.d.ts.map +1 -0
- package/dist/esm/utils/resolvable.js +12 -0
- package/dist/esm/utils/resolvable.js.map +1 -0
- package/dist/esm/utils/schemaInstrumentation.d.ts +16 -0
- package/dist/esm/utils/schemaInstrumentation.d.ts.map +1 -0
- package/dist/esm/utils/schemaInstrumentation.js +69 -0
- package/dist/esm/utils/schemaInstrumentation.js.map +1 -0
- package/dist/esm/utils/schemaManager.d.ts +31 -0
- package/dist/esm/utils/schemaManager.d.ts.map +1 -0
- package/dist/esm/utils/schemaManager.js +99 -0
- package/dist/esm/utils/schemaManager.js.map +1 -0
- package/dist/esm/utils/urlForHttpServer.d.ts +3 -0
- package/dist/esm/utils/urlForHttpServer.d.ts.map +1 -0
- package/dist/esm/utils/urlForHttpServer.js +12 -0
- package/dist/esm/utils/urlForHttpServer.js.map +1 -0
- package/dist/esm/validationRules/NoIntrospection.d.ts +3 -0
- package/dist/esm/validationRules/NoIntrospection.d.ts.map +1 -0
- package/dist/esm/validationRules/NoIntrospection.js +15 -0
- package/dist/esm/validationRules/NoIntrospection.js.map +1 -0
- package/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts +4 -0
- package/dist/esm/validationRules/RecursiveSelectionsLimit.d.ts.map +1 -0
- package/dist/esm/validationRules/RecursiveSelectionsLimit.js +146 -0
- package/dist/esm/validationRules/RecursiveSelectionsLimit.js.map +1 -0
- package/dist/esm/validationRules/index.d.ts +3 -0
- package/dist/esm/validationRules/index.d.ts.map +1 -0
- package/dist/esm/validationRules/index.js +3 -0
- package/dist/esm/validationRules/index.js.map +1 -0
- package/errors/package.json +8 -0
- package/package.json +208 -0
- package/plugin/cacheControl/package.json +8 -0
- package/plugin/disableSuggestions/package.json +8 -0
- package/plugin/disabled/package.json +8 -0
- package/plugin/drainHttpServer/package.json +8 -0
- package/plugin/inlineTrace/package.json +8 -0
- package/plugin/landingPage/default/package.json +8 -0
- package/plugin/schemaReporting/package.json +8 -0
- package/plugin/subscriptionCallback/package.json +8 -0
- package/plugin/usageReporting/package.json +8 -0
- package/src/ApolloServer.ts +1456 -0
- package/src/cachePolicy.ts +33 -0
- package/src/determineApolloConfig.ts +95 -0
- package/src/errorNormalize.ts +114 -0
- package/src/errors/index.ts +33 -0
- package/src/externalTypes/constructor.ts +174 -0
- package/src/externalTypes/context.ts +18 -0
- package/src/externalTypes/graphql.ts +81 -0
- package/src/externalTypes/http.ts +44 -0
- package/src/externalTypes/incrementalDeliveryPolyfillAlpha2.ts +63 -0
- package/src/externalTypes/incrementalDeliveryPolyfillAlpha9.ts +82 -0
- package/src/externalTypes/index.ts +73 -0
- package/src/externalTypes/plugins.ts +222 -0
- package/src/externalTypes/requestPipeline.ts +123 -0
- package/src/generated/packageVersion.ts +1 -0
- package/src/httpBatching.ts +105 -0
- package/src/incrementalDeliveryPolyfill.ts +253 -0
- package/src/index.ts +4 -0
- package/src/internalErrorClasses.ts +123 -0
- package/src/internalPlugin.ts +42 -0
- package/src/plugin/cacheControl/index.ts +453 -0
- package/src/plugin/disableSuggestions/index.ts +23 -0
- package/src/plugin/disabled/index.ts +41 -0
- package/src/plugin/drainHttpServer/index.ts +42 -0
- package/src/plugin/drainHttpServer/stoppable.ts +109 -0
- package/src/plugin/inlineTrace/index.ts +156 -0
- package/src/plugin/landingPage/default/getEmbeddedHTML.ts +204 -0
- package/src/plugin/landingPage/default/index.ts +219 -0
- package/src/plugin/landingPage/default/types.ts +198 -0
- package/src/plugin/schemaIsSubgraph.ts +41 -0
- package/src/plugin/schemaReporting/generated/operations.d.ts +18359 -0
- package/src/plugin/schemaReporting/index.ts +198 -0
- package/src/plugin/schemaReporting/schemaReporter.ts +207 -0
- package/src/plugin/subscriptionCallback/index.ts +724 -0
- package/src/plugin/traceTreeBuilder.ts +356 -0
- package/src/plugin/usageReporting/defaultSendOperationsAsTrace.ts +74 -0
- package/src/plugin/usageReporting/durationHistogram.ts +87 -0
- package/src/plugin/usageReporting/index.ts +9 -0
- package/src/plugin/usageReporting/iterateOverTrace.ts +140 -0
- package/src/plugin/usageReporting/operationDerivedDataCache.ts +61 -0
- package/src/plugin/usageReporting/options.ts +414 -0
- package/src/plugin/usageReporting/plugin.ts +871 -0
- package/src/plugin/usageReporting/stats.ts +492 -0
- package/src/plugin/usageReporting/traceDetails.ts +96 -0
- package/src/preventCsrf.ts +99 -0
- package/src/requestPipeline.ts +821 -0
- package/src/runHttpQuery.ts +408 -0
- package/src/standalone/index.ts +155 -0
- package/src/utils/HeaderMap.ts +22 -0
- package/src/utils/UnreachableCaseError.ts +10 -0
- package/src/utils/computeCoreSchemaHash.ts +9 -0
- package/src/utils/invokeHooks.ts +53 -0
- package/src/utils/isDefined.ts +3 -0
- package/src/utils/makeGatewayGraphQLRequestContext.ts +197 -0
- package/src/utils/resolvable.ts +30 -0
- package/src/utils/schemaInstrumentation.ts +132 -0
- package/src/utils/schemaManager.ts +212 -0
- package/src/utils/urlForHttpServer.ts +21 -0
- package/src/validationRules/NoIntrospection.ts +27 -0
- package/src/validationRules/RecursiveSelectionsLimit.ts +198 -0
- package/src/validationRules/index.ts +5 -0
- package/standalone/package.json +8 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
2
|
+
import type { ReferencedFieldsByType } from '@apollo/utils.usagereporting';
|
|
3
|
+
import { LRUCache } from 'lru-cache';
|
|
4
|
+
|
|
5
|
+
export interface OperationDerivedData {
|
|
6
|
+
signature: string;
|
|
7
|
+
referencedFieldsByType: ReferencedFieldsByType;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function createOperationDerivedDataCache({
|
|
11
|
+
logger,
|
|
12
|
+
}: {
|
|
13
|
+
logger: Logger;
|
|
14
|
+
}): LRUCache<string, OperationDerivedData> {
|
|
15
|
+
let lastWarn: Date;
|
|
16
|
+
let lastDisposals = 0;
|
|
17
|
+
return new LRUCache<string, OperationDerivedData>({
|
|
18
|
+
// Calculate the length of cache objects by the JSON.stringify byteLength.
|
|
19
|
+
sizeCalculation(obj) {
|
|
20
|
+
return Buffer.byteLength(JSON.stringify(obj), 'utf8');
|
|
21
|
+
},
|
|
22
|
+
// 10MiB limit, very much approximately since we can't be sure how V8 might
|
|
23
|
+
// be storing this data internally. Though this should be enough to store a
|
|
24
|
+
// fair amount of operation data, depending on their overall complexity. A
|
|
25
|
+
// future version of this might expose some configuration option to grow the
|
|
26
|
+
// cache, but ideally, we could do that dynamically based on the resources
|
|
27
|
+
// available to the server, and not add more configuration surface area.
|
|
28
|
+
// Hopefully the warning message will allow us to evaluate the need with
|
|
29
|
+
// more validated input from those that receive it.
|
|
30
|
+
maxSize: Math.pow(2, 20) * 10,
|
|
31
|
+
dispose() {
|
|
32
|
+
// Count the number of disposals between warning messages.
|
|
33
|
+
lastDisposals++;
|
|
34
|
+
|
|
35
|
+
// Only show a message warning about the high turnover every 60 seconds.
|
|
36
|
+
if (!lastWarn || new Date().getTime() - lastWarn.getTime() > 60000) {
|
|
37
|
+
// Log the time that we last displayed the message.
|
|
38
|
+
lastWarn = new Date();
|
|
39
|
+
logger.warn(
|
|
40
|
+
[
|
|
41
|
+
'This server is processing a high number of unique operations. ',
|
|
42
|
+
`A total of ${lastDisposals} records have been `,
|
|
43
|
+
'ejected from the ApolloServerPluginUsageReporting signature cache in the past ',
|
|
44
|
+
'interval. If you see this warning frequently, please open an ',
|
|
45
|
+
'issue on the Apollo Server repository.',
|
|
46
|
+
].join(''),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Reset the disposal counter for the next message interval.
|
|
50
|
+
lastDisposals = 0;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function operationDerivedDataCacheKey(
|
|
57
|
+
queryHash: string,
|
|
58
|
+
operationName: string,
|
|
59
|
+
) {
|
|
60
|
+
return `${queryHash}${operationName && ':' + operationName}`;
|
|
61
|
+
}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import type { GraphQLError, DocumentNode } from 'graphql';
|
|
2
|
+
import type {
|
|
3
|
+
GraphQLRequestContextDidResolveOperation,
|
|
4
|
+
GraphQLRequestContext,
|
|
5
|
+
GraphQLRequestContextWillSendResponse,
|
|
6
|
+
BaseContext,
|
|
7
|
+
} from '../../externalTypes/index.js';
|
|
8
|
+
import type { Logger } from '@apollo/utils.logger';
|
|
9
|
+
import type { Trace } from '@apollo/usage-reporting-protobuf';
|
|
10
|
+
import type { Fetcher } from '@apollo/utils.fetcher';
|
|
11
|
+
|
|
12
|
+
export interface ApolloServerPluginUsageReportingOptions<
|
|
13
|
+
TContext extends BaseContext,
|
|
14
|
+
> {
|
|
15
|
+
//#region Configure exactly which data should be sent to Apollo.
|
|
16
|
+
/**
|
|
17
|
+
* Apollo Server's usage reports describe each individual request in one of
|
|
18
|
+
* two ways: as a "trace" (a detailed description of the specific request,
|
|
19
|
+
* including a query plan and resolver tree with timings and errors, as well
|
|
20
|
+
* as optional details like variable values and HTTP headers), or as part of
|
|
21
|
+
* aggregated "stats" (where invocations of the same operation from the same
|
|
22
|
+
* client program are aggregated together rather than described individually).
|
|
23
|
+
* Apollo Server uses an heuristic to decide which operations to describe as
|
|
24
|
+
* traces and which to aggregate as stats.
|
|
25
|
+
*
|
|
26
|
+
* By setting the `sendTraces` option to `false`, Apollo Server will describe
|
|
27
|
+
* *all* operations as stats; individual requests will never be broken out
|
|
28
|
+
* into separate traces. If you set `sendTraces: false`, then Apollo Studio's
|
|
29
|
+
* Traces view won't show any traces (other Studio functionality will be
|
|
30
|
+
* unaffected).
|
|
31
|
+
*
|
|
32
|
+
* Note that the values of `sendVariableValues`, `sendHeaders`, and
|
|
33
|
+
* `sendUnexecutableOperationDocuments` are irrelevant if you set
|
|
34
|
+
* `sendTraces: false`, because those options control data that is contained
|
|
35
|
+
* only in traces (not in stats).
|
|
36
|
+
*
|
|
37
|
+
* Setting `sendTraces: false` does *NOT* imply `fieldLevelInstrumentation:
|
|
38
|
+
* 0`. Apollo Server can still take advantage of field-level instrumentation
|
|
39
|
+
* (either directly for monolith servers, or via federated tracing for
|
|
40
|
+
* Gateways) in order to accurately report field execution usage in "stats".
|
|
41
|
+
* This option only controls whether data is sent to Apollo's servers as
|
|
42
|
+
* traces, not whether traces are internally used to learn about usage.
|
|
43
|
+
*/
|
|
44
|
+
sendTraces?: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* By default, Apollo Server does not send the values of any GraphQL variables
|
|
48
|
+
* to Apollo's servers, because variable values often contain the private data
|
|
49
|
+
* of your app's users. If you'd like variable values to be included in
|
|
50
|
+
* traces, set this option. This option can take several forms:
|
|
51
|
+
* - { none: true }: don't send any variable values (DEFAULT)
|
|
52
|
+
* - { all: true}: send all variable values
|
|
53
|
+
* - { transform: ... }: a custom function for modifying variable values. The
|
|
54
|
+
* function receives `variables` and `operationString` and should return a
|
|
55
|
+
* record of `variables` with the same keys as the `variables` it receives
|
|
56
|
+
* (added variables will be ignored and removed variables will be reported
|
|
57
|
+
* with an empty value). For security reasons, if an error occurs within
|
|
58
|
+
* this function, all variable values will be replaced with
|
|
59
|
+
* `[PREDICATE_FUNCTION_ERROR]`.
|
|
60
|
+
* - { exceptNames: ... }: a case-sensitive list of names of variables whose
|
|
61
|
+
* values should not be sent to Apollo servers
|
|
62
|
+
* - { onlyNames: ... }: A case-sensitive list of names of variables whose
|
|
63
|
+
* values will be sent to Apollo servers
|
|
64
|
+
*
|
|
65
|
+
* Defaults to not sending any variable values if both this parameter and the
|
|
66
|
+
* deprecated `privateVariables` are not set. The report will indicate each
|
|
67
|
+
* private variable key whose value was redacted by { none: true } or {
|
|
68
|
+
* exceptNames: [...] }.
|
|
69
|
+
*
|
|
70
|
+
* The value of this option is not relevant if you set `sendTraces: false`,
|
|
71
|
+
* because variable values only appear in traces.
|
|
72
|
+
*/
|
|
73
|
+
sendVariableValues?: VariableValueOptions;
|
|
74
|
+
/**
|
|
75
|
+
* By default, Apollo Server does not send the HTTP request headers and values
|
|
76
|
+
* to Apollo's servers, as these headers may contain your users' private data.
|
|
77
|
+
* If you'd like this information included in traces, set this option. This
|
|
78
|
+
* option can take several forms:
|
|
79
|
+
*
|
|
80
|
+
* - { none: true } to drop all HTTP request headers (DEFAULT)
|
|
81
|
+
* - { all: true } to send the values of all HTTP request headers
|
|
82
|
+
* - { exceptNames: Array<String> } A case-insensitive list of names of HTTP
|
|
83
|
+
* headers whose values should not be sent to Apollo servers
|
|
84
|
+
* - { onlyNames: Array<String> }: A case-insensitive list of names of HTTP
|
|
85
|
+
* headers whose values will be sent to Apollo servers
|
|
86
|
+
*
|
|
87
|
+
* Unlike with sendVariableValues, names of dropped headers are not reported.
|
|
88
|
+
* The headers 'authorization', 'cookie', and 'set-cookie' are never reported.
|
|
89
|
+
*
|
|
90
|
+
* The value of this option is not relevant if you set `sendTraces: false`,
|
|
91
|
+
* because request headers only appear in traces.
|
|
92
|
+
*/
|
|
93
|
+
sendHeaders?: SendValuesBaseOptions;
|
|
94
|
+
/**
|
|
95
|
+
* By default, if a trace contains errors, the errors are reported to Apollo
|
|
96
|
+
* servers with the message `<masked>`. The errors are associated with
|
|
97
|
+
* specific paths in the operation, but do not include the original error
|
|
98
|
+
* message or any extensions such as the error `code`, as those details may
|
|
99
|
+
* contain your users' private data. The extension `maskedBy:
|
|
100
|
+
* 'ApolloServerPluginUsageReporting'` is added.
|
|
101
|
+
*
|
|
102
|
+
* If you'd like details about the error included in traces, set this option.
|
|
103
|
+
* This option can take several forms:
|
|
104
|
+
*
|
|
105
|
+
* - { masked: true }: mask error messages and omit extensions (DEFAULT)
|
|
106
|
+
* - { unmodified: true }: send all error messages and extensions to Apollo
|
|
107
|
+
* servers
|
|
108
|
+
* - { transform: ... }: a custom function for transforming errors. This
|
|
109
|
+
* function receives a `GraphQLError` and may return a `GraphQLError`
|
|
110
|
+
* (either a new error, or its potentially-modified argument) or `null`.
|
|
111
|
+
* This error is used in the report to Apollo servers; if `null`, the error
|
|
112
|
+
* is not included in traces or error statistics.
|
|
113
|
+
*
|
|
114
|
+
* If you set `sendTraces: false`, then the only relevant aspect of this
|
|
115
|
+
* option is whether you return `null` from a `transform` function or not
|
|
116
|
+
* (which affects aggregated error statistics).
|
|
117
|
+
*/
|
|
118
|
+
sendErrors?: SendErrorsOptions;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* This option allows you to choose if Apollo Server should calculate detailed
|
|
122
|
+
* per-field statistics for a particular request. It is only called for
|
|
123
|
+
* executable operations: operations which parse and validate properly and
|
|
124
|
+
* which do not have an unknown operation name. It is not called if an
|
|
125
|
+
* `includeRequest` hook is provided and returns false.
|
|
126
|
+
*
|
|
127
|
+
* You can either pass an async function or a number. The function receives a
|
|
128
|
+
* `GraphQLRequestContext`. (The effect of passing a number is described
|
|
129
|
+
* later.) Your function can return a boolean or a number; returning false is
|
|
130
|
+
* equivalent to returning 0 and returning true is equivalent to returning 1.
|
|
131
|
+
*
|
|
132
|
+
* Returning false (or 0) means that Apollo Server will only pay attention to
|
|
133
|
+
* overall properties of the operation, like what GraphQL operation is
|
|
134
|
+
* executing and how long the entire operation takes to execute, and not
|
|
135
|
+
* anything about field-by-field execution.
|
|
136
|
+
*
|
|
137
|
+
* If you return false (or 0), this operation *will* still contribute to most
|
|
138
|
+
* features of Studio, such as schema checks, the Operations page, and the
|
|
139
|
+
* "referencing operations" statistic on the Fields page, etc.
|
|
140
|
+
*
|
|
141
|
+
* If you return false (or 0), this operation will *not* contribute to the
|
|
142
|
+
* "field executions" statistic on the Fields page or to the execution timing
|
|
143
|
+
* hints optionally displayed in Studio Explorer or in vscode-graphql.
|
|
144
|
+
* Additionally, this operation will not produce a trace that can be viewed on
|
|
145
|
+
* the Traces section of the Operations page.
|
|
146
|
+
*
|
|
147
|
+
* Returning false (or 0) for some or all operations can improve your server's
|
|
148
|
+
* performance, as the overhead of calculating complete traces is not always
|
|
149
|
+
* negligible. This is especially the case if this server is an Apollo
|
|
150
|
+
* Gateway, as captured traces are transmitted from the subgraph to the
|
|
151
|
+
* Gateway in-band inside the actual GraphQL response.
|
|
152
|
+
*
|
|
153
|
+
* Returning a positive number means that Apollo Server will track each field
|
|
154
|
+
* execution and send Apollo Studio statistics on how many times each field
|
|
155
|
+
* was executed and what the per-field performance was. Apollo Server sends
|
|
156
|
+
* both a precise observed execution count and an estimated execution count.
|
|
157
|
+
* The former is calculated by counting each field execution as 1, and the
|
|
158
|
+
* latter is calculated by counting each field execution as the number
|
|
159
|
+
* returned from this hook, which can be thought of as a weight.
|
|
160
|
+
*
|
|
161
|
+
* Passing a number `x` (which should be between 0 and 1 inclusive) for
|
|
162
|
+
* `fieldLevelInstrumentation` is equivalent to passing the function `async ()
|
|
163
|
+
* => Math.random() < x ? 1/x : 0`. For example, if you pass 0.01, then 99%
|
|
164
|
+
* of the time this function will return 0, and 1% of the time this function
|
|
165
|
+
* will return 100. So 99% of the time Apollo Server will not track field
|
|
166
|
+
* executions, and 1% of the time Apollo Server will track field executions
|
|
167
|
+
* and send them to Apollo Studio both as an exact observed count and as an
|
|
168
|
+
* "estimated" count which is 100 times higher. Generally, the weights you
|
|
169
|
+
* return should be roughly the reciprocal of the probability that the
|
|
170
|
+
* function returns non-zero; however, you're welcome to craft a more
|
|
171
|
+
* sophisticated function, such as one that uses a higher probability for
|
|
172
|
+
* rarer operations and a lower probability for more common operations.
|
|
173
|
+
*
|
|
174
|
+
* (Note that returning true here does *not* mean that the data derived from
|
|
175
|
+
* field-level instrumentation must be transmitted to Apollo Studio's servers
|
|
176
|
+
* in the form of a trace; it may still be aggregated locally to statistics.
|
|
177
|
+
* Similarly, setting `sendTraces: false` does not affect
|
|
178
|
+
* `fieldLevelInstrumentation`. But either way this operation will contribute
|
|
179
|
+
* to the "field executions" statistic and timing hints.)
|
|
180
|
+
*
|
|
181
|
+
* The default `fieldLevelInstrumentation` is a function that always returns
|
|
182
|
+
* true.
|
|
183
|
+
*/
|
|
184
|
+
fieldLevelInstrumentation?:
|
|
185
|
+
| number
|
|
186
|
+
| ((
|
|
187
|
+
request: GraphQLRequestContextDidResolveOperation<TContext>,
|
|
188
|
+
) => Promise<number | boolean>);
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* This option allows you to choose if a particular request should be
|
|
192
|
+
* represented in the usage reporting sent to Apollo servers. By default, all
|
|
193
|
+
* requests are included. If this async predicate function is specified, its
|
|
194
|
+
* return value will determine whether a given request is included.
|
|
195
|
+
*
|
|
196
|
+
* Note that returning false here means that the operation will be completely
|
|
197
|
+
* ignored by all Apollo Studio features. If you merely want to improve
|
|
198
|
+
* performance by skipping the field-level execution trace, set the
|
|
199
|
+
* `fieldLevelInstrumentation` option instead of this one.
|
|
200
|
+
*
|
|
201
|
+
* The predicate function receives the request context. If validation and
|
|
202
|
+
* parsing of the request succeeds, the function will receive the request
|
|
203
|
+
* context in the
|
|
204
|
+
* [`GraphQLRequestContextDidResolveOperation`](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#didresolveoperation)
|
|
205
|
+
* phase, which permits tracing based on dynamic properties, e.g., HTTP
|
|
206
|
+
* headers or the `operationName` (when available). Otherwise it will receive
|
|
207
|
+
* the request context in the
|
|
208
|
+
* [`GraphQLRequestContextWillSendResponse`](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#willsendresponse)
|
|
209
|
+
* phase:
|
|
210
|
+
*
|
|
211
|
+
* (If you don't want any usage reporting at all, don't use this option:
|
|
212
|
+
* instead, either avoid specifying an Apollo API key, or use
|
|
213
|
+
* ApolloServerPluginUsageReportingDisabled to prevent this plugin from being
|
|
214
|
+
* created by default.)
|
|
215
|
+
*
|
|
216
|
+
* **Example:**
|
|
217
|
+
*
|
|
218
|
+
* ```js
|
|
219
|
+
* includeRequest(requestContext) {
|
|
220
|
+
* // Always include `query HomeQuery { ... }`.
|
|
221
|
+
* if (requestContext.operationName === "HomeQuery") return true;
|
|
222
|
+
*
|
|
223
|
+
* // Omit if the "report-to-apollo" header is set to "false".
|
|
224
|
+
* if (requestContext.request.http?.headers?.get("report-to-apollo") === "false") {
|
|
225
|
+
* return false;
|
|
226
|
+
* }
|
|
227
|
+
*
|
|
228
|
+
* // Otherwise include.
|
|
229
|
+
* return true;
|
|
230
|
+
* },
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
*/
|
|
234
|
+
includeRequest?: (
|
|
235
|
+
request:
|
|
236
|
+
| GraphQLRequestContextDidResolveOperation<TContext>
|
|
237
|
+
| GraphQLRequestContextWillSendResponse<TContext>,
|
|
238
|
+
) => Promise<boolean>;
|
|
239
|
+
/**
|
|
240
|
+
* By default, this plugin associates client information such as name
|
|
241
|
+
* and version with user requests based on HTTP headers starting with
|
|
242
|
+
* `apollographql-client-`. If you have another way of communicating
|
|
243
|
+
* client information to your server, tell the plugin how it works
|
|
244
|
+
* with this option.
|
|
245
|
+
*/
|
|
246
|
+
generateClientInfo?: GenerateClientInfo<TContext>;
|
|
247
|
+
/**
|
|
248
|
+
* If you are using the `overrideReportedSchema` option to the schema
|
|
249
|
+
* reporting plugin (`ApolloServerPluginSchemaReporting`), you should
|
|
250
|
+
* pass the same value here as well, so that the schema ID associated
|
|
251
|
+
* with requests in this plugin's usage reports matches the schema
|
|
252
|
+
* ID that the other plugin reports.
|
|
253
|
+
*/
|
|
254
|
+
overrideReportedSchema?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Whether to include the entire document in the trace if the operation
|
|
257
|
+
* was a GraphQL parse or validation error (i.e. failed the GraphQL parse or
|
|
258
|
+
* validation phases). This will be included as a separate field on the trace
|
|
259
|
+
* and the operation name and signature will always be reported with a constant
|
|
260
|
+
* identifier. Whether the operation was a parse failure or a validation
|
|
261
|
+
* failure will be embedded within the stats report key itself.
|
|
262
|
+
*
|
|
263
|
+
* The value of this option is not relevant if you set `sendTraces: false`,
|
|
264
|
+
* because unexecutable operation documents only appear in traces.
|
|
265
|
+
*/
|
|
266
|
+
sendUnexecutableOperationDocuments?: boolean;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* This plugin sends information about operations to Apollo's servers in two
|
|
270
|
+
* forms: as detailed operation traces of single operations and as summarized
|
|
271
|
+
* statistics of many operations. Each individual operation is described in
|
|
272
|
+
* exactly one of those ways. This hook lets you select which operations are
|
|
273
|
+
* sent as traces and which are sent as statistics. The default is a heuristic
|
|
274
|
+
* that tries to send one trace for each rough duration bucket for each
|
|
275
|
+
* operation each minute, plus more if the operations have errors. (Note that
|
|
276
|
+
* Apollo's servers perform their own sampling on received traces; not all
|
|
277
|
+
* traces sent to Apollo's servers can be later retrieved via the trace UI.)
|
|
278
|
+
*
|
|
279
|
+
* If you just want to send all operations as stats, set `sendTraces: false`
|
|
280
|
+
* instead of using this experimental hook.
|
|
281
|
+
*
|
|
282
|
+
* This option is highly experimental and may change or be removed in future
|
|
283
|
+
* versions.
|
|
284
|
+
*/
|
|
285
|
+
experimental_sendOperationAsTrace?: (
|
|
286
|
+
trace: Trace,
|
|
287
|
+
statsReportKey: string,
|
|
288
|
+
) => boolean;
|
|
289
|
+
//#endregion
|
|
290
|
+
|
|
291
|
+
//#region Configure the mechanics of communicating with Apollo's servers.
|
|
292
|
+
/**
|
|
293
|
+
* Sends a usage report after every request. This options is useful for
|
|
294
|
+
* stateless environments like Amazon Lambda where processes handle only a
|
|
295
|
+
* small number of requests before terminating. It defaults to true when the
|
|
296
|
+
* ApolloServer was started in the background with
|
|
297
|
+
* `startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests`
|
|
298
|
+
* (generally used with serverless frameworks), or false otherwise. (Note that
|
|
299
|
+
* "immediately" does not mean synchronously with completing the response, but
|
|
300
|
+
* "very soon", such as after a setImmediate call.)
|
|
301
|
+
*/
|
|
302
|
+
sendReportsImmediately?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Specifies which Fetch API implementation to use when sending usage reports.
|
|
305
|
+
*/
|
|
306
|
+
fetcher?: Fetcher;
|
|
307
|
+
/**
|
|
308
|
+
* How often to send reports to Apollo. We'll also send reports when the
|
|
309
|
+
* report gets big; see maxUncompressedReportSize.
|
|
310
|
+
*/
|
|
311
|
+
reportIntervalMs?: number;
|
|
312
|
+
/**
|
|
313
|
+
* We send a report when the report size will become bigger than this size in
|
|
314
|
+
* bytes (default: 4MB). (This is a rough limit --- we ignore the size of the
|
|
315
|
+
* report header and some other top level bytes. We just add up the lengths of
|
|
316
|
+
* the serialized traces and signatures.)
|
|
317
|
+
*/
|
|
318
|
+
maxUncompressedReportSize?: number;
|
|
319
|
+
/**
|
|
320
|
+
* Reporting is retried with exponential backoff up to this many times
|
|
321
|
+
* (including the original request). Defaults to 5.
|
|
322
|
+
*/
|
|
323
|
+
maxAttempts?: number;
|
|
324
|
+
/**
|
|
325
|
+
* Minimum back-off for retries. Defaults to 100ms.
|
|
326
|
+
*/
|
|
327
|
+
minimumRetryDelayMs?: number;
|
|
328
|
+
/**
|
|
329
|
+
* Timeout for each individual attempt to send a report to Apollo. (This is
|
|
330
|
+
* for each HTTP POST, not for all potential retries.) Defaults to 30 seconds
|
|
331
|
+
* (30000ms).
|
|
332
|
+
*/
|
|
333
|
+
requestTimeoutMs?: number;
|
|
334
|
+
/**
|
|
335
|
+
* A logger interface to be used for output and errors. When not provided
|
|
336
|
+
* it will default to the server's own `logger` implementation and use
|
|
337
|
+
* `console` when that is not available.
|
|
338
|
+
*/
|
|
339
|
+
logger?: Logger;
|
|
340
|
+
/**
|
|
341
|
+
* By default, if an error occurs when sending trace reports to Apollo
|
|
342
|
+
* servers, its message will be sent to the `error` method on the logger
|
|
343
|
+
* specified with the `logger` option to this plugin or to ApolloServer (or to
|
|
344
|
+
* `console.error` by default). Specify this function to process errors in a
|
|
345
|
+
* different way. (The difference between using this option and using a logger
|
|
346
|
+
* is that this option receives the actual Error object whereas `logger.error`
|
|
347
|
+
* only receives its message.)
|
|
348
|
+
*/
|
|
349
|
+
reportErrorFunction?: (err: Error) => void;
|
|
350
|
+
//#endregion
|
|
351
|
+
|
|
352
|
+
//#region Internal and non-recommended options
|
|
353
|
+
/**
|
|
354
|
+
* The URL base that we send reports to (not including the path). This option
|
|
355
|
+
* only needs to be set for testing and Apollo-internal uses.
|
|
356
|
+
*/
|
|
357
|
+
endpointUrl?: string;
|
|
358
|
+
/**
|
|
359
|
+
* If set, prints all reports as JSON when they are sent. (Note that for
|
|
360
|
+
* technical reasons, traces embedded in a report are printed separately when
|
|
361
|
+
* they are added to a report.) Reports are sent through `logger.info`.
|
|
362
|
+
*/
|
|
363
|
+
debugPrintReports?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Specify the function for creating a signature for a query. See signature.ts
|
|
366
|
+
* for details. This option is not recommended, as Apollo's servers make assumptions
|
|
367
|
+
* about how the signature relates to the operation you executed.
|
|
368
|
+
*/
|
|
369
|
+
calculateSignature?: (ast: DocumentNode, operationName: string) => string;
|
|
370
|
+
/**
|
|
371
|
+
* This option is for internal use by `@apollo/server` only.
|
|
372
|
+
*
|
|
373
|
+
* By default we want to enable this plugin for non-subgraph schemas only, but
|
|
374
|
+
* we need to come up with our list of plugins before we have necessarily
|
|
375
|
+
* loaded the schema. So (unless the user installs this plugin or
|
|
376
|
+
* ApolloServerPluginUsageReportingDisabled themselves), `@apollo/server`
|
|
377
|
+
* always installs this plugin (if API key and graph ref are provided) and
|
|
378
|
+
* uses this option to disable usage reporting if the schema is a subgraph.
|
|
379
|
+
*/
|
|
380
|
+
__onlyIfSchemaIsNotSubgraph?: boolean;
|
|
381
|
+
//#endregion
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export type SendValuesBaseOptions =
|
|
385
|
+
| { onlyNames: Array<string> }
|
|
386
|
+
| { exceptNames: Array<string> }
|
|
387
|
+
| { all: true }
|
|
388
|
+
| { none: true };
|
|
389
|
+
|
|
390
|
+
type VariableValueTransformOptions = {
|
|
391
|
+
variables: Record<string, any>;
|
|
392
|
+
operationString?: string;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
export type VariableValueOptions =
|
|
396
|
+
| {
|
|
397
|
+
transform: (
|
|
398
|
+
options: VariableValueTransformOptions,
|
|
399
|
+
) => Record<string, any>;
|
|
400
|
+
}
|
|
401
|
+
| SendValuesBaseOptions;
|
|
402
|
+
|
|
403
|
+
export type SendErrorsOptions =
|
|
404
|
+
| { unmodified: true }
|
|
405
|
+
| { masked: true }
|
|
406
|
+
| { transform: (err: GraphQLError) => GraphQLError | null };
|
|
407
|
+
|
|
408
|
+
export interface ClientInfo {
|
|
409
|
+
clientName?: string;
|
|
410
|
+
clientVersion?: string;
|
|
411
|
+
}
|
|
412
|
+
export type GenerateClientInfo<TContext extends BaseContext> = (
|
|
413
|
+
requestContext: GraphQLRequestContext<TContext>,
|
|
414
|
+
) => ClientInfo;
|