mirror of
https://github.com/graphql-hive/console
synced 2026-05-24 09:38:26 +00:00
Temporarily support graphql-client-vesion header (#139)
Our CLI sent a header with a typo. We'll support both for next 30 days or more to collect correct versions. After that, we will drop the header and use SchemaPublishMissingServiceError in schemaPublish mutation by default.
This commit is contained in:
parent
24f7d9bf61
commit
2aca3b8e2e
1 changed files with 8 additions and 1 deletions
|
|
@ -117,7 +117,14 @@ export const graphqlHandler = (options: GraphQLHandlerOptions): RouteHandlerMeth
|
|||
endpoint: process.env.HIVE_USAGE_ENDPOINT,
|
||||
clientInfo(ctx: { req: FastifyRequest; reply: FastifyReply }) {
|
||||
const name = ctx.req.headers['graphql-client-name'] as string;
|
||||
const version = (ctx.req.headers['graphql-client-version'] as string) ?? 'missing';
|
||||
const version =
|
||||
((ctx.req.headers['graphql-client-version'] as string) ||
|
||||
// Our CLI sent a header with a typo.
|
||||
// We'll support both for next 30 days or more to collect correct versions.
|
||||
// After that, we will drop the header
|
||||
// and use SchemaPublishMissingServiceError in schemaPublish mutation by default.
|
||||
(ctx.req.headers['graphql-client-vesion'] as string)) ??
|
||||
'missing';
|
||||
|
||||
if (name) {
|
||||
return { name, version };
|
||||
|
|
|
|||
Loading…
Reference in a new issue