From 2523d9fa954b82e11412918aab2ae6fe7e7611d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kroupa?= Date: Tue, 5 Nov 2024 15:51:19 +0100 Subject: [PATCH] chore: fix PR 3448 (#3457) Co-authored-by: Tomas Kroupa --- .changeset/changelog1.md | 6 ++++++ .changeset/changelog2.md | 6 ++++++ package.json | 2 +- packages/plugins/apollo-usage-report/src/index.ts | 5 ++--- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .changeset/changelog1.md create mode 100644 .changeset/changelog2.md diff --git a/.changeset/changelog1.md b/.changeset/changelog1.md new file mode 100644 index 0000000000..8a97c230ca --- /dev/null +++ b/.changeset/changelog1.md @@ -0,0 +1,6 @@ +--- +"@graphql-yoga/plugin-apollo-usage-report": patch +--- + +### Fixed +- do not set default values for `clientName` and `clientVersion` diff --git a/.changeset/changelog2.md b/.changeset/changelog2.md new file mode 100644 index 0000000000..af383397aa --- /dev/null +++ b/.changeset/changelog2.md @@ -0,0 +1,6 @@ +--- +'graphql-yoga': patch +--- + +### Fixed +- propagation of Yoga `version` diff --git a/package.json b/package.json index a8735e07d2..d3d74d08aa 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "apollo" ], "scripts": { - "build": "pnpm --filter=@graphql-yoga/graphiql run build && pnpm --filter=@graphql-yoga/render-graphiql run build && pnpm --filter=graphql-yoga run generate-graphiql-html&& pnpm --filter=graphql-yoga run inject-version && bob build", + "build": "pnpm --filter=@graphql-yoga/graphiql run build && pnpm --filter=@graphql-yoga/render-graphiql run build && pnpm --filter=graphql-yoga run generate-graphiql-html && bob build && pnpm --filter=graphql-yoga run inject-version", "build-website": "pnpm build && cd website && pnpm build", "changeset": "changeset", "check": "pnpm -r run check", diff --git a/packages/plugins/apollo-usage-report/src/index.ts b/packages/plugins/apollo-usage-report/src/index.ts index bbfe42ec29..ca6c5bfe7e 100644 --- a/packages/plugins/apollo-usage-report/src/index.ts +++ b/packages/plugins/apollo-usage-report/src/index.ts @@ -88,8 +88,7 @@ export function useApolloUsageReport(options: ApolloUsageReportOptions = {}): Pl ]), ) as YogaLogger; - let clientNameFactory: StringFromRequestFn = req => - req.headers.get('apollographql-client-name') || 'graphql-yoga'; + let clientNameFactory: StringFromRequestFn = req => req.headers.get('apollographql-client-name'); if (typeof options.clientName === 'string') { const clientName = options.clientName; @@ -99,7 +98,7 @@ export function useApolloUsageReport(options: ApolloUsageReportOptions = {}): Pl } let clientVersionFactory: StringFromRequestFn = req => - req.headers.get('apollographql-client-version') || yoga.version; + req.headers.get('apollographql-client-version'); if (typeof options.clientVersion === 'string') { const clientVersion = options.clientVersion;