@envelop/newrelic
Changelog for @envelop/newrelic: every release with its changes and the pull requests behind them.
11.0.0
Major Changes
-
#4574
79b0e8bThanks @egoodwinx! - ### Breaking Changes- Node: minimum supported version is now Node 22. Node 18 and 20 are no longer supported. Future releases will only support Node >=22.
- GraphQL: minimum supported version is now GraphQL 16. GraphQL 14 and 15 are no longer supported.
- Request body parsing: Yoga now limits request bodies to 25,000,000 bytes by default.
Enforcing this limit streams the body through a byte counter, making POST body parsing
asynchronous even for an in-memory body. As a result,
yoga.fetch()can return a Promise where it previously returned a synchronous Response, even when all resolvers and plugins are synchronous.
Migration
- If you’re on Node 18/20, upgrade to Node 22 or later before upgrading this package.
- If you’re on graphql 14/15, upgrade to graphql 16 or 17 first.
- Await
yoga.fetch()and response body parsing instead of relying on synchronous results. SetmaxRequestBodySize: falseincreateYogato disable the body-size limit and preserve synchronous parsing for in-memory bodies, but only if you enforce an appropriate request-body limit elsewhere.
Minor Changes
-
#4575
862447aThanks @egoodwinx! - Use@graphql-hive/loggerand add correlated, per-request logging (closes #4048)Every request now gets its own logger, available as
context.log(andserverContext.login plugin hooks), tagged with arequestId. Everything logged while handling a request can be correlated by that id.The request id is taken from the host integration if it already assigned one (e.g. Fastify’s
request.id), otherwise from the incomingx-request-idheader, otherwise generated. It is also sent back in thex-request-idresponse header. Configure it with the newrequestIdoption:createYoga({ requestId: { // don't trust the incoming header, recommended when clients can reach the server directly trustHeader: false, headerName: 'x-correlation-id', generateRequestId: () => myId() } })Pass
requestId: falseto disable it.At the
infolevel, a single “Request processed” line is logged per request with the method, path, operation name and type, response status, error count and duration. At thedebuglevel, more details about request processing are logged.Masked errors are now logged with the request’s logger, so they can be traced back to the request that caused them. Custom
maskErrorfunctions receive the request’s context as an optional fourth argument.The
@envelop/newrelic,@envelop/auth0,@envelop/resource-limitations,@envelop/statsd,@envelop/graphql-jit,@envelop/response-cacheand@envelop/response-cache-cloudflare-kvplugins accept a newlogoption for their own messages, instead of always writing to the console.@envelop/response-cache’sshouldCacheResultnow also receives the GraphQLcontext.Breaking Changes
- The
@graphql-yoga/loggerpackage has been removed.graphql-yogare-exportsLogger,MemoryLogWriterandLogLevelfrom@graphql-hive/loggerinstead. createLoggerand theYogaLoggertype are no longer exported. Usenew Logger(options)instead.- The
loggingoption now takesboolean | Logger | LogLevel, whereLoggeris the one from@graphql-hive/logger. yoga.loggerhas been renamed toyoga.log.- The
loggeroption ofuseGraphiQLanduseHealthCheckhas been removed. They now log through the request’s logger. @graphql-yoga/nestjsnow logs through Nest’sLoggerby default instead of not logging at all. Passlogging: falseto keep the previous behaviour.logging: trueon Fastify no longer logs through Fastify’s logger, pass it explicitly instead (see below).@envelop/apollo-federation,@envelop/auth0,@envelop/graphql-jit,@envelop/newrelic,@envelop/resource-limitations,@envelop/response-cache,@envelop/response-cache-cloudflare-kvand@envelop/statsdnow have a peer dependency on@graphql-hive/loggerthat you must install.@envelop/apollo-federation’sloggeroption now expects aLoggerfrom@graphql-hive/loggerand defaults tonew Logger()instead ofconsole.
Migration
Create loggers with
Logger:- import { createLogger } from 'graphql-yoga'; + import { Logger } from 'graphql-yoga'; createYoga({ - logging: createLogger('debug'), + logging: new Logger({ level: 'debug' }), });Use
loginstead ofloggeron the Yoga instance:const plugin = { onYogaInit({ yoga }) { - yoga.logger.info('ready'); + yoga.log.info('ready'); }, };Prefer the request-scoped logger inside resolvers and plugin hooks so the logs carry the request id:
const resolvers = { Query: { hello: (_, __, context) => { context.log.debug('resolving hello') return 'world' } } }If you use any of the
@envelop/*plugins listed above, install the logger:npm i @graphql-hive/loggerIf you depended on
@graphql-yoga/loggerdirectly, switch to@graphql-hive/logger:- import { Logger } from '@graphql-yoga/logger'; + import { Logger } from '@graphql-hive/logger';To keep logging through Fastify’s logger in
@graphql-yoga/nestjs:import { Logger } from 'graphql-yoga' import { PinoLogWriter } from '@graphql-hive/logger/writers/pino' // in your yoga driver options logging: new Logger({ writers: [new PinoLogWriter(app.log)] }) - The
Patch Changes
- Updated dependencies
[
862447a,79b0e8b,be89d05,79b0e8b]:- @envelop/core@6.0.0
- @envelop/on-resolve@8.0.0
10.2.2
Patch Changes
- #4514
ec75be3Thanks @beaumontjonathan! - Bump newrelic latest peer dependency from 11 to 14
10.2.1
Patch Changes
-
#4577
7bff35cThanks @egoodwinx! - Add homepage and bugs.url to package.json files -
Updated dependencies [
7bff35c]:- @envelop/on-resolve@7.2.1
- @envelop/core@5.6.1
10.2.0
Minor Changes
-
#4545
94ebe5bThanks @egoodwinx! - Update to support graphql-js 17Bump package versions, fix expected typing, and update compatability with subscribe.
Patch Changes
- Updated dependencies
[
94ebe5b]:- @envelop/on-resolve@7.2.0
- @envelop/core@5.6.0
10.1.1
Patch Changes
- Updated dependencies
[
0bfde27]:- @envelop/core@5.5.1
- @envelop/on-resolve@7.1.1
10.1.0
Patch Changes
10.0.0
Patch Changes
- Updated dependencies
[
0434fbd]:- @envelop/core@5.4.0
- @envelop/on-resolve@7.0.0
9.0.0
Patch Changes
- Updated dependencies
[
3ebaa3b]:- @envelop/core@5.3.0
- @envelop/on-resolve@6.0.0
8.1.3
Patch Changes
8.1.2
Patch Changes
8.1.1
Patch Changes
8.1.0
Patch Changes
8.0.1
Patch Changes
8.0.0
Patch Changes
- Updated dependencies
[
9bd1b20]:- @envelop/core@5.1.0
- @envelop/on-resolve@5.0.0
7.1.0
Patch Changes
- Updated dependencies
[
408f5be3]:- @envelop/on-resolve@4.1.0
7.0.0
Major Changes
-
#1986
68e7a2a5Thanks @EmrysMyrddin! - Breaking Change: Support of Node 16 is dropped. -
Updated dependencies [
68e7a2a5,f7ef03c0]:- @envelop/core@5.0.0
Patch Changes
- Updated dependencies
[
68e7a2a5]:- @envelop/on-resolve@4.0.0
6.0.4
Patch Changes
-
#1927
e3c90116Thanks @renovate! - dependencies updates:- Updated dependency
@envelop/on-resolve@^3.0.2↗︎ (from^3.0.1, independencies) - Updated dependency
@envelop/core@^4.0.2↗︎ (from^4.0.1, inpeerDependencies)
- Updated dependency
-
Updated dependencies [
dee6b8d2]:- @envelop/core@4.0.3
-
Updated dependencies [
e3c90116]:- @envelop/on-resolve@3.0.3
6.0.3
Patch Changes
- Updated dependencies
[
db20864a]:- @envelop/core@4.0.2
- Updated dependencies []:
- @envelop/on-resolve@3.0.2
6.0.2
Patch Changes
-
#1935
89ae34e3Thanks @EmrysMyrddin! - dependencies updates:- Updated dependency
newrelic@>=7 <12↗︎ (from^7 || ^8.0.0, inpeerDependencies)
- Updated dependency
-
Updated dependencies []:
- @envelop/core@4.0.1
-
Updated dependencies []:
- @envelop/on-resolve@3.0.1
6.0.1
Patch Changes
- #1606
58085615Thanks @ardatan! - FixCannot read properties of null (reading 'namestate')error when NewRelic env vars are invalid
6.0.0
Major Changes
-
#1776
332f1f22Thanks @ardatan! - Drop Node 14 and require Node 16 or higher -
Updated dependencies [
332f1f22,a36925c7]:- @envelop/core@4.0.0
Patch Changes
- #1728
a36925c7Thanks @ardatan! - - Memoize parsed document string result and use it wherever possible, and exportgetDocumentStringfunction to allow users to use it as well.- Use
WeakMaps withDocumentNodewherever possible instead of using LRU Cache with strings. It is more optimal if a parser caching is used
- Use
- Updated dependencies
[
332f1f22,7066ce98]:- @envelop/on-resolve@3.0.0
5.0.6
Patch Changes
-
#1725
c1eb2c09Thanks @n1ru4l! - dependencies updates:- Updated dependency
tslib@^2.5.0↗︎ (from^2.4.0, independencies)
- Updated dependency
-
Updated dependencies [
c1eb2c09]:- @envelop/core@3.0.6
-
Updated dependencies []:
- @envelop/on-resolve@2.0.6
5.0.5
Patch Changes
- Updated dependencies
[
270249cf]:- @envelop/core@3.0.5
- Updated dependencies []:
- @envelop/on-resolve@2.0.5
5.0.4
Patch Changes
- Updated dependencies []:
- @envelop/core@3.0.4
- Updated dependencies []:
- @envelop/on-resolve@2.0.4
5.0.3
Patch Changes
- Updated dependencies
[
6b48ef96]:- @envelop/core@3.0.3
- Updated dependencies []:
- @envelop/on-resolve@2.0.3
5.0.2
Patch Changes
- Updated dependencies
[
22f5ccfb]:- @envelop/core@3.0.2
- Updated dependencies []:
- @envelop/on-resolve@2.0.2
5.0.0
Major Changes
- Updated dependencies
[
dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5,dc1e24b5]:- @envelop/core@3.0.0
Patch Changes
- Updated dependencies
[
dc1e24b5]:- @envelop/on-resolve@2.0.0
4.3.0
Minor Changes
-
#1499
1f7af02bThanks @viniciuspalma! - Adding tslib to package dependenciesProjects that currently are using yarn Berry with PnP or any strict dependency resolver, that requires that all dependencies are specified on package.json otherwise it would endue in an error if not treated correct
Since https://www.typescriptlang.org/tsconfig#importHelpers is currently being used, tslib should be exported as a dependency to external runners get the proper import.
Change on each package:
// package.json { "dependencies": { "tslib": "^2.4.0" } } -
Updated dependencies [
1f7af02b,ae7bc9a3]:- @envelop/core@2.6.0
4.2.0
Minor Changes
Patch Changes
- #1457
ff8b4476Thanks @zawadzkip! - New Relic: add error for agent not being found Adds an error message when initializing the new relic plugin- This error message will occur when the new relic agent is not found when initializing the plugin. Signalling information to a developer that new relic may not be
- installed correctly or may be disabled where this plugin is being instantiated.
4.1.2
Patch Changes
- 071f946: Fix CommonJS TypeScript resolution with
moduleResolutionnode16ornodenext - Updated dependencies [071f946]
- @envelop/core@2.4.2
4.1.1
Patch Changes
- Updated dependencies [787d28a2]
- @envelop/core@2.4.1
4.1.0
Minor Changes
- 8bb2738: Support TypeScript module resolution.
- Updated dependencies [8bb2738]
- @envelop/core@2.4.0
4.0.2
Patch Changes
- fbf6155: update package.json repository links to point to the new home
- Updated dependencies [fbf6155]
- @envelop/core@2.3.3
4.0.1
Patch Changes
- Updated dependencies [07d029b]
- @envelop/core@2.3.2
4.0.0
Major Changes
-
6106340: Set a custom operation name through a function that reads from context
🚀 Breaking Change:
In order to set a custom operation name, you can no longer use the
operationNamePropertyoption. You will, instead, be able to use the new functionextractOperationNamewhich receives the context and so allows for greater customisation by accessing nested properties or context extensions from other Envelop plugins.const getEnveloped = envelop({ plugins: [ // ... other plugins ... useNewRelic({ // ... extractOperationName: context => context.request.body.customOperationName }) ] })
Patch Changes
- Updated dependencies [d5c2c9a]
- @envelop/core@2.3.1
3.4.0
Minor Changes
- Updated dependencies [af23408]
- @envelop/core@2.3.0
3.3.0
Minor Changes
- Updated dependencies [ada7fb0]
- Updated dependencies [d5115b4]
- Updated dependencies [d5115b4]
- @envelop/core@2.2.0
3.2.1
Patch Changes
- cfd45e1: Fix skipError function implementation by applying it to onExecuteDone
3.2.0
Minor Changes
- 64d83a2: feat(newrelic): support async iterable results
Patch Changes
- 64d83a2: enhance(newrelic): import newrelic only if plugin is enabled
3.1.0
Minor Changes
- Updated dependencies [78b3db2]
- Updated dependencies [f5eb436]
- @envelop/core@2.1.0
3.0.0
Patch Changes
- Updated dependencies [4106e08]
- Updated dependencies [aac65ef]
- Updated dependencies [4106e08]
- @envelop/core@2.0.0
2.0.0
Patch Changes
- Updated dependencies [d9cfb7c]
- @envelop/core@1.7.0
1.3.0
Minor Changes
- 5679a70: Respect Envelop errors in NewRelic plugin
1.2.1
Patch Changes
-
b1a0331: Properly list
@envelop/coreas apeerDependencyin plugins.This resolves issues where the bundled envelop plugins published to npm had logic inlined from the
@envelop/corepackage, causinginstanceofcheck ofEnvelopErrorto fail. -
Updated dependencies [b1a0331]
- @envelop/core@1.6.1
1.2.0
Minor Changes
- 090cae4: GraphQL v16 support
1.1.0
Minor Changes
- 04120de: add support for GraphQL.js 16
1.0.3
Patch Changes
- 422a6c6: fix ESM
1.0.2
Patch Changes
- 94db02d: Update usage of plugins to use the correct
isAsyncIterableand new helperhandleStreamOrSingleExecutionResult
1.0.1
Patch Changes
- 8021229: fix ESM graphql import
1.0.0
Major Changes
- 40bc444: v1 major release for envelop packages
0.0.4
Patch Changes
- 932f6a8: Better type-safety for hooks
0.0.3
Patch Changes
- 28ad742: Improve TypeScript types
0.0.2
Patch Changes
-
5c69373: Fixed retrieval of root operation from Envelop context
NOTE: There is a breaking behaviour. When using the
operationNamePropertyoption, this will be checked against thedocumentobject rather than theoperationobject as in initial version.
0.0.1
Patch Changes
- 12c16bd: Initial New Relic plugin implementation