stellate 3.0.4 → 3.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.
@@ -0,0 +1,14 @@
1
+ import { ApolloServerPlugin } from '@apollo/server';
2
+
3
+ interface Options {
4
+ serviceName: string;
5
+ token: string;
6
+ fetch: typeof fetch;
7
+ sendVariablesAsHash?: boolean;
8
+ schemaSyncing?: boolean;
9
+ }
10
+ declare function createBlake3Hash(str: string): number;
11
+
12
+ declare const createStellateLoggerPlugin: (options: Options) => ApolloServerPlugin;
13
+
14
+ export { createBlake3Hash, createStellateLoggerPlugin };
@@ -95,8 +95,7 @@ var createStellateLoggerPlugin = (options) => {
95
95
  if (shouldSyncSchema) {
96
96
  const introspection = introspectionFromSchema(apiSchema);
97
97
  const randomTimeout = Math.random() * 5e3;
98
- if (timeout)
99
- clearTimeout(timeout);
98
+ if (timeout) clearTimeout(timeout);
100
99
  timeout = setTimeout(async () => {
101
100
  timeout = null;
102
101
  if (!stopped) {
@@ -136,11 +135,9 @@ var createStellateLoggerPlugin = (options) => {
136
135
  const start = Date.now();
137
136
  const { request } = requestCtx;
138
137
  const { operationName, variables, http, query } = request;
139
- if (!http)
140
- return;
138
+ if (!http) return;
141
139
  const { headers, method } = http;
142
- if (headers.has("gcdn-request-id"))
143
- return;
140
+ if (headers.has("gcdn-request-id")) return;
144
141
  return {
145
142
  async willSendResponse(respContext) {
146
143
  var _a2, _b2;
@@ -153,8 +150,7 @@ var createStellateLoggerPlugin = (options) => {
153
150
  }
154
151
  const respBody = response.body.singleResult;
155
152
  const queryString = query || source;
156
- if (!queryString)
157
- return;
153
+ if (!queryString) return;
158
154
  const graphqlClientName = ((_a2 = request.http) == null ? void 0 : _a2.headers.get("x-graphql-client-name")) || void 0;
159
155
  const graphqlClientVersion = ((_b2 = request.http) == null ? void 0 : _b2.headers.get("x-graphql-client-version")) || void 0;
160
156
  const stellatePayload = extractStellatePayload({