Skip to content

Commit

Permalink
fix(graphql): change et-client-name to increase rate limit (#1656)
Browse files Browse the repository at this point in the history
* fix(graphql): change et-client-name to increase rate limit

* fix(graphql): change et-client-name in useLines

* chore(graphql): change client_name to entur-tavla
  • Loading branch information
SelmaBergstrand authored Sep 26, 2024
1 parent 0d9d5fa commit 7f185f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tavla/app/(admin)/edit/[id]/components/TileCard/useLines.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GRAPHQL_ENDPOINTS } from 'assets/env'
import { CLIENT_NAME, GRAPHQL_ENDPOINTS } from 'assets/env'
import { QuayEditQuery, StopPlaceEditQuery } from 'graphql/index'
import { useEffect, useState } from 'react'
import { TQuay } from 'types/graphql-schema'
Expand All @@ -12,7 +12,7 @@ function useLines(tile: TTile): TLineFragment[] | null {
fetch(GRAPHQL_ENDPOINTS['journey-planner'], {
headers: {
'Content-Type': 'application/json',
'ET-Client-Name': 'tavla-test',
'ET-Client-Name': CLIENT_NAME,
},
body: JSON.stringify({
query:
Expand Down
2 changes: 1 addition & 1 deletion tavla/src/Shared/assets/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export const GRAPHQL_ENDPOINTS: Record<TEndpointNames, string> = {
export const COUNTY_ENDPOINT = 'https://ws.geonorge.no/kommuneinfo/v1/fylker'
export const GEOCODER_ENDPOINT = 'https://api.entur.io/geocoder/v1'

export const CLIENT_NAME = 'entur-tavla-staging'
export const CLIENT_NAME = 'entur-tavla'
4 changes: 2 additions & 2 deletions tavla/src/Shared/graphql/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GRAPHQL_ENDPOINTS, TEndpointNames } from 'assets/env'
import { CLIENT_NAME, GRAPHQL_ENDPOINTS, TEndpointNames } from 'assets/env'
import { TypedDocumentString } from './index'

export async function fetcher<Data, Variables>([
Expand All @@ -9,7 +9,7 @@ export async function fetcher<Data, Variables>([
return fetch(GRAPHQL_ENDPOINTS[endpointName], {
headers: {
'Content-Type': 'application/json',
'ET-Client-Name': 'tavla-test',
'ET-Client-Name': CLIENT_NAME,
},
body: JSON.stringify({ query, variables }),
method: 'POST',
Expand Down

0 comments on commit 7f185f4

Please sign in to comment.