@@ -4,7 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
44import { ERROR_CODES } from "@/shared/api/errors" ;
55import { PRIORITY_HEADER } from "@/shared/api/priority" ;
66import { queryClient } from "@/shared/api/rest/client" ;
7- import { CONFIG } from "@/shared/config/config" ;
7+ import { INFRAHUB_API_SERVER_URL } from "@/shared/config/config" ;
88
99import { ACCESS_TOKEN_KEY , REFRESH_TOKEN_KEY } from "@/entities/authentication/api/token-storage" ;
1010import { __navigation } from "@/entities/authentication/domain/use-cases/redirect-to-login" ;
@@ -44,12 +44,12 @@ describe("graphqlClient — endpoint targeting", () => {
4444 vi . unstubAllGlobals ( ) ;
4545 } ) ;
4646
47- it ( "targets the default branch when the operation declares no context" , async ( ) => {
47+ it ( "omits the branch segment when the operation declares no context" , async ( ) => {
4848 // WHEN
4949 await graphqlClient . query ( { query : PING } ) ;
5050
5151 // THEN
52- expect ( fetchSpy . mock . calls [ 0 ] ?. [ 0 ] ) . toBe ( CONFIG . GRAPHQL_URL ( ) ) ;
52+ expect ( fetchSpy . mock . calls [ 0 ] ?. [ 0 ] ) . toBe ( ` ${ INFRAHUB_API_SERVER_URL } /graphql` ) ;
5353 } ) ;
5454
5555 it ( "targets the branch and point in time the operation declares" , async ( ) => {
@@ -60,7 +60,9 @@ describe("graphqlClient — endpoint targeting", () => {
6060 await graphqlClient . query ( { query : PING , context : { branch : "feature" , date } } ) ;
6161
6262 // THEN
63- expect ( fetchSpy . mock . calls [ 0 ] ?. [ 0 ] ) . toBe ( CONFIG . GRAPHQL_URL ( "feature" , date ) ) ;
63+ expect ( fetchSpy . mock . calls [ 0 ] ?. [ 0 ] ) . toBe (
64+ `${ INFRAHUB_API_SERVER_URL } /graphql/feature?at=2026-01-01T00:00:00.000Z`
65+ ) ;
6466 } ) ;
6567
6668 it ( "stamps X-Priority: high on every operation" , async ( ) => {
0 commit comments