Initial Save
This commit is contained in:
19
node_modules/apollo-tracing/dist/index.d.ts
generated
vendored
Normal file
19
node_modules/apollo-tracing/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ApolloServerPlugin } from "apollo-server-plugin-base";
|
||||
export interface TracingFormat {
|
||||
version: 1;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
duration: number;
|
||||
execution: {
|
||||
resolvers: {
|
||||
path: (string | number)[];
|
||||
parentType: string;
|
||||
fieldName: string;
|
||||
returnType: string;
|
||||
startOffset: number;
|
||||
duration: number;
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export declare const plugin: (_futureOptions?: {}) => () => ApolloServerPlugin;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/apollo-tracing/dist/index.d.ts.map
generated
vendored
Normal file
1
node_modules/apollo-tracing/dist/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAI/D,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,CAAC,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE;QACT,SAAS,EAAE;YACT,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;YAC1B,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC;SAClB,EAAE,CAAC;KACL,CAAC;CACH;AAWD,eAAO,MAAM,MAAM,iCAAgC,kBA8FjD,CAAA"}
|
||||
72
node_modules/apollo-tracing/dist/index.js
generated
vendored
Normal file
72
node_modules/apollo-tracing/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.plugin = void 0;
|
||||
const graphql_1 = require("graphql");
|
||||
const { name: PACKAGE_NAME } = require("../package.json");
|
||||
exports.plugin = (_futureOptions = {}) => () => ({
|
||||
requestDidStart() {
|
||||
const startWallTime = new Date();
|
||||
let endWallTime;
|
||||
const startHrTime = process.hrtime();
|
||||
let duration;
|
||||
const resolverCalls = [];
|
||||
return {
|
||||
executionDidStart: () => ({
|
||||
executionDidEnd: () => {
|
||||
duration = process.hrtime(startHrTime);
|
||||
endWallTime = new Date();
|
||||
},
|
||||
willResolveField({ info }) {
|
||||
const resolverCall = {
|
||||
path: info.path,
|
||||
fieldName: info.fieldName,
|
||||
parentType: info.parentType,
|
||||
returnType: info.returnType,
|
||||
startOffset: process.hrtime(startHrTime),
|
||||
};
|
||||
resolverCalls.push(resolverCall);
|
||||
return () => {
|
||||
resolverCall.endOffset = process.hrtime(startHrTime);
|
||||
};
|
||||
},
|
||||
}),
|
||||
willSendResponse({ response }) {
|
||||
if (typeof endWallTime === 'undefined' ||
|
||||
typeof duration === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const extensions = response.extensions || (response.extensions = Object.create(null));
|
||||
if (typeof extensions.tracing !== 'undefined') {
|
||||
throw new Error(PACKAGE_NAME + ": Could not add `tracing` to " +
|
||||
"`extensions` since `tracing` was unexpectedly already present.");
|
||||
}
|
||||
extensions.tracing = {
|
||||
version: 1,
|
||||
startTime: startWallTime.toISOString(),
|
||||
endTime: endWallTime.toISOString(),
|
||||
duration: durationHrTimeToNanos(duration),
|
||||
execution: {
|
||||
resolvers: resolverCalls.map(resolverCall => {
|
||||
const startOffset = durationHrTimeToNanos(resolverCall.startOffset);
|
||||
const duration = resolverCall.endOffset
|
||||
? durationHrTimeToNanos(resolverCall.endOffset) - startOffset
|
||||
: 0;
|
||||
return {
|
||||
path: [...graphql_1.responsePathAsArray(resolverCall.path)],
|
||||
parentType: resolverCall.parentType.toString(),
|
||||
fieldName: resolverCall.fieldName,
|
||||
returnType: resolverCall.returnType.toString(),
|
||||
startOffset,
|
||||
duration,
|
||||
};
|
||||
}),
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
function durationHrTimeToNanos(hrtime) {
|
||||
return hrtime[0] * 1e9 + hrtime[1];
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/apollo-tracing/dist/index.js.map
generated
vendored
Normal file
1
node_modules/apollo-tracing/dist/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAIiB;AAGjB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AA4B7C,QAAA,MAAM,GAAG,CAAC,cAAc,GAAG,EAAE,EAAE,EAAE,CAAC,GAAuB,EAAE,CAAC,CAAC;IACxE,eAAe;QACb,MAAM,aAAa,GAAS,IAAI,IAAI,EAAE,CAAC;QACvC,IAAI,WAA6B,CAAC;QAClC,MAAM,WAAW,GAAuB,OAAO,CAAC,MAAM,EAAE,CAAC;QACzD,IAAI,QAAwC,CAAC;QAC7C,MAAM,aAAa,GAAmB,EAAE,CAAC;QAGzC,OAAO;YACL,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC;gBAYxB,eAAe,EAAE,GAAG,EAAE;oBACpB,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;oBACvC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC3B,CAAC;gBAED,gBAAgB,CAAC,EAAE,IAAI,EAAE;oBACvB,MAAM,YAAY,GAAiB;wBACjC,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,UAAU,EAA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