Skip to content

Commit

Permalink
chore: fix PR 3448 (#3457)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomas Kroupa <tomas.kroupa@applifting.cz>
  • Loading branch information
kroupacz and Tomas Kroupa authored Nov 5, 2024
1 parent 708d908 commit 2523d9f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/changelog1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-yoga/plugin-apollo-usage-report": patch
---

### Fixed
- do not set default values for `clientName` and `clientVersion`
6 changes: 6 additions & 0 deletions .changeset/changelog2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'graphql-yoga': patch
---

### Fixed
- propagation of Yoga `version`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions packages/plugins/apollo-usage-report/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 2523d9f

Please sign in to comment.