File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,3 @@ export const siteConfig: SiteConfig = {
99
1010export const locales = [ 'en' , 'hi' ] ;
1111
12- export const gqlConfig = {
13- url : `${ process . env . BACKEND_GRAPHQL_URL } ` ,
14- headers : {
15- organization : '1' ,
16- } ,
17- } ;
Original file line number Diff line number Diff line change @@ -4,20 +4,19 @@ import { QueryClient } from '@tanstack/react-query';
44import { request } from 'graphql-request' ;
55import { getSession } from 'next-auth/react' ;
66
7- import { gqlConfig } from '@/config/site' ;
8-
97// create a wrapper function for graphql-request
108// that will be used by react-query
119
1210export async function GraphQL < TResult , TVariables > (
1311 document : TypedDocumentNode < TResult , TVariables > ,
12+ entityHeaders : Record < string , string > = { } ,
1413 ...[ variables ] : TVariables extends Record < string , never > ? [ ] : [ TVariables ]
1514) {
1615 const session = await getSession ( ) ;
1716
1817 const headers = {
19- ...gqlConfig . headers ,
2018 ...( session ? { Authorization : session ?. access_token } : { } ) ,
19+ ...entityHeaders ,
2120 } ;
2221
2322 const data = await request (
You can’t perform that action at this time.
0 commit comments