@graphql-yoga/plugin-apollo-usage-report
Advanced tools
Comparing version 0.5.7-alpha-20250114104343-cf3fb3860993f8ac48b0eff0bfc0e1fbc168324d to 0.5.7-alpha-20250115184000-273903bba880109a878bfecad5d89ba918be5cc2
@@ -15,3 +15,2 @@ "use strict"; | ||
const [instrumentation, ctxForReq] = (0, plugin_apollo_inline_trace_1.useApolloInstrumentation)(options); | ||
let schemaIdSet$; | ||
let schemaId; | ||
@@ -46,11 +45,7 @@ let yoga; | ||
if (schema) { | ||
schemaIdSet$ = hashSHA256((0, graphql_1.printSchema)(schema), yoga.fetchAPI).then(id => { | ||
hashSHA256((0, graphql_1.printSchema)(schema)).then(id => { | ||
schemaId = id; | ||
schemaIdSet$ = undefined; | ||
}); | ||
} | ||
}, | ||
onRequestParse() { | ||
return schemaIdSet$; | ||
}, | ||
onParse() { | ||
@@ -88,4 +83,3 @@ return function onParseEnd({ result, context }) { | ||
if (!trace.schemaId || !trace.operationKey) { | ||
logger.debug('Misformed trace, missing operation key or schema id'); | ||
continue; | ||
throw new TypeError('Misformed trace, missing operation key or schema id'); | ||
} | ||
@@ -92,0 +86,0 @@ const clientName = clientNameFactory(request); |
@@ -11,3 +11,2 @@ import { getOperationAST, Kind, printSchema, stripIgnoredCharacters } from 'graphql'; | ||
const [instrumentation, ctxForReq] = useApolloInstrumentation(options); | ||
let schemaIdSet$; | ||
let schemaId; | ||
@@ -42,11 +41,7 @@ let yoga; | ||
if (schema) { | ||
schemaIdSet$ = hashSHA256(printSchema(schema), yoga.fetchAPI).then(id => { | ||
hashSHA256(printSchema(schema)).then(id => { | ||
schemaId = id; | ||
schemaIdSet$ = undefined; | ||
}); | ||
} | ||
}, | ||
onRequestParse() { | ||
return schemaIdSet$; | ||
}, | ||
onParse() { | ||
@@ -84,4 +79,3 @@ return function onParseEnd({ result, context }) { | ||
if (!trace.schemaId || !trace.operationKey) { | ||
logger.debug('Misformed trace, missing operation key or schema id'); | ||
continue; | ||
throw new TypeError('Misformed trace, missing operation key or schema id'); | ||
} | ||
@@ -88,0 +82,0 @@ const clientName = clientNameFactory(request); |
{ | ||
"name": "@graphql-yoga/plugin-apollo-usage-report", | ||
"version": "0.5.7-alpha-20250114104343-cf3fb3860993f8ac48b0eff0bfc0e1fbc168324d", | ||
"version": "0.5.7-alpha-20250115184000-273903bba880109a878bfecad5d89ba918be5cc2", | ||
"description": "Apollo's GraphOS usage report plugin for GraphQL Yoga.", | ||
"peerDependencies": { | ||
"graphql": "^15.2.0 || ^16.0.0", | ||
"graphql-yoga": "^5.10.9" | ||
"graphql-yoga": "^5.10.10-alpha-20250115184000-273903bba880109a878bfecad5d89ba918be5cc2" | ||
}, | ||
"dependencies": { | ||
"@apollo/usage-reporting-protobuf": "^4.1.1", | ||
"tslib": "^2.5.2", | ||
"@graphql-yoga/plugin-apollo-inline-trace": "^3.10.9" | ||
"tslib": "^2.8.1", | ||
"@graphql-yoga/plugin-apollo-inline-trace": "^3.10.10-alpha-20250115184000-273903bba880109a878bfecad5d89ba918be5cc2" | ||
}, | ||
@@ -14,0 +14,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
import { type Maybe, type Plugin, type YogaInitialContext } from 'graphql-yoga'; | ||
import { Maybe, Plugin, 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
21567
356
+ Added@envelop/on-resolve@4.1.1(transitive)
+ Added@graphql-yoga/plugin-apollo-inline-trace@3.10.11(transitive)
- Removed@graphql-yoga/plugin-apollo-inline-trace@3.10.10(transitive)
Updatedtslib@^2.8.1