mirror of
https://github.com/graphql-hive/console
synced 2026-05-23 17:18:23 +00:00
Add graphql-client-* headers to GraphQL calls in client (#2984)
This commit is contained in:
parent
0c14917f63
commit
c5a9946da3
2 changed files with 5 additions and 0 deletions
|
|
@ -98,6 +98,8 @@ export function createHive(options: HivePluginOptions): HiveClient {
|
|||
'content-type': 'application/json',
|
||||
Authorization: `Bearer ${options.token}`,
|
||||
'user-agent': `hive-client/${version}`,
|
||||
'graphql-client-name': 'Hive Client',
|
||||
'graphql-client-version': version,
|
||||
},
|
||||
timeout: 30_000,
|
||||
decompress: true,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import axios from 'axios';
|
||||
import type { DocumentNode } from 'graphql';
|
||||
import { parse, stripIgnoredCharacters } from 'graphql';
|
||||
import { version } from '../version.js';
|
||||
import type { HivePluginOptions } from './types.js';
|
||||
|
||||
export interface OperationsStore {
|
||||
|
|
@ -52,6 +53,8 @@ export function createOperationsStore(pluginOptions: HivePluginOptions): Operati
|
|||
headers: {
|
||||
'content-type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
'graphql-client-name': 'Hive Client',
|
||||
'graphql-client-version': version,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue