@envelop/newrelic 4.2.0-alpha-20220815073159-82280bf2 → 4.2.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/cjs/index.js CHANGED
@@ -63,6 +63,9 @@ const useNewRelic = (rawOptions) => {
63
63
  options.isResolverArgsRegex = options.includeResolverArgs instanceof RegExp;
64
64
  const instrumentationApi$ = Promise.resolve().then(() => __importStar(require('newrelic'))).then(m => m.default || m)
65
65
  .then(({ shim }) => {
66
+ if (!(shim === null || shim === void 0 ? void 0 : shim.agent)) {
67
+ throw new Error('Agent unavailable. Please check your New Relic Agent configuration and ensure New Relic is enabled.');
68
+ }
66
69
  shim.agent.metrics
67
70
  .getOrCreateMetric(`Supportability/ExternalModules/${AttributeName.COMPONENT_NAME}`)
68
71
  .incrementCallCount();
package/esm/index.js CHANGED
@@ -37,6 +37,9 @@ export const useNewRelic = (rawOptions) => {
37
37
  const instrumentationApi$ = import('newrelic')
38
38
  .then(m => m.default || m)
39
39
  .then(({ shim }) => {
40
+ if (!(shim === null || shim === void 0 ? void 0 : shim.agent)) {
41
+ throw new Error('Agent unavailable. Please check your New Relic Agent configuration and ensure New Relic is enabled.');
42
+ }
40
43
  shim.agent.metrics
41
44
  .getOrCreateMetric(`Supportability/ExternalModules/${AttributeName.COMPONENT_NAME}`)
42
45
  .incrementCallCount();
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@envelop/newrelic",
3
- "version": "4.2.0-alpha-20220815073159-82280bf2",
3
+ "version": "4.2.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.5.0-alpha-20220815073159-82280bf2",
6
+ "@envelop/core": "^2.5.0",
7
7
  "newrelic": "^7 || ^8.0.0",
8
8
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
9
9
  },