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,16 @@
1
+ import { Plugin } from '@envelop/core';
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: (opts: Options) => Plugin<{
13
+ request: Request;
14
+ }>;
15
+
16
+ export { createBlake3Hash, createStellateLoggerPlugin };
package/dist/envelop.mjs CHANGED
@@ -112,8 +112,7 @@ var createStellateLoggerPlugin = (options) => {
112
112
  if (shouldSyncSchema) {
113
113
  const apiSchema = opts.schema;
114
114
  const randomTimeout = Math.random() * 5e3;
115
- if (timeout)
116
- clearTimeout(timeout);
115
+ if (timeout) clearTimeout(timeout);
117
116
  timeout = setTimeout(async () => {
118
117
  timeout = null;
119
118
  try {
@@ -153,8 +152,7 @@ var createStellateLoggerPlugin = (options) => {
153
152
  headers
154
153
  );
155
154
  }
156
- if (headers.has("gcdn-request-id"))
157
- return;
155
+ if (headers.has("gcdn-request-id")) return;
158
156
  const stellatePayload = extractStellatePayload({
159
157
  headers,
160
158
  operation: print(payload.args.document),
@@ -0,0 +1,14 @@
1
+ import { Plugin } from 'graphql-yoga';
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: (opts: Options) => Plugin;
13
+
14
+ export { createBlake3Hash, createStellateLoggerPlugin };
@@ -98,8 +98,7 @@ var createStellateLoggerPlugin = (options) => {
98
98
  if (shouldSyncSchema) {
99
99
  const apiSchema = opts.schema;
100
100
  const randomTimeout = Math.random() * 5e3;
101
- if (timeout)
102
- clearTimeout(timeout);
101
+ if (timeout) clearTimeout(timeout);
103
102
  timeout = setTimeout(async () => {
104
103
  timeout = null;
105
104
  try {
@@ -134,8 +133,7 @@ var createStellateLoggerPlugin = (options) => {
134
133
  return;
135
134
  }
136
135
  const { headers, method } = payload.args.contextValue.request;
137
- if (headers.has("gcdn-request-id"))
138
- return;
136
+ if (headers.has("gcdn-request-id")) return;
139
137
  const graphqlClientName = headers.get("x-graphql-client-name") || void 0;
140
138
  const graphqlClientVersion = headers.get("x-graphql-client-version") || void 0;
141
139
  const stellatePayload = extractStellatePayload({