@graphql-yoga/plugin-apollo-usage-report
Advanced tools
Comparing version 0.5.6 to 0.5.7-alpha-20250114100629-0c81a3088551143abce54173b1b5c39daf2ee80c
@@ -15,2 +15,3 @@ "use strict"; | ||
const [instrumentation, ctxForReq] = (0, plugin_apollo_inline_trace_1.useApolloInstrumentation)(options); | ||
let schemaId$; | ||
let schemaId; | ||
@@ -45,3 +46,8 @@ let yoga; | ||
if (schema) { | ||
hashSHA256((0, graphql_1.printSchema)(schema)).then(id => { | ||
schemaId$ = hashSHA256((0, graphql_1.printSchema)(schema)); | ||
} | ||
}, | ||
onRequestParse() { | ||
if (!schemaId) { | ||
return schemaId$.then(id => { | ||
schemaId = id; | ||
@@ -48,0 +54,0 @@ }); |
@@ -11,2 +11,3 @@ import { getOperationAST, Kind, printSchema, stripIgnoredCharacters } from 'graphql'; | ||
const [instrumentation, ctxForReq] = useApolloInstrumentation(options); | ||
let schemaId$; | ||
let schemaId; | ||
@@ -41,3 +42,8 @@ let yoga; | ||
if (schema) { | ||
hashSHA256(printSchema(schema)).then(id => { | ||
schemaId$ = hashSHA256(printSchema(schema)); | ||
} | ||
}, | ||
onRequestParse() { | ||
if (!schemaId) { | ||
return schemaId$.then(id => { | ||
schemaId = id; | ||
@@ -44,0 +50,0 @@ }); |
{ | ||
"name": "@graphql-yoga/plugin-apollo-usage-report", | ||
"version": "0.5.6", | ||
"version": "0.5.7-alpha-20250114100629-0c81a3088551143abce54173b1b5c39daf2ee80c", | ||
"description": "Apollo's GraphOS usage report plugin for GraphQL Yoga.", | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
@@ -1,2 +0,2 @@ | ||
import { Maybe, Plugin, YogaInitialContext } from 'graphql-yoga'; | ||
import { type Maybe, type Plugin, type YogaInitialContext } from 'graphql-yoga'; | ||
import { ApolloInlineGraphqlTraceContext, ApolloInlineRequestTraceContext, ApolloInlineTracePluginOptions } from '@graphql-yoga/plugin-apollo-inline-trace'; | ||
@@ -3,0 +3,0 @@ type ApolloUsageReportOptions = ApolloInlineTracePluginOptions & { |
Sorry, the diff of this file is not supported yet
21843
368