@@ -66,10 +66,7 @@ import {
66
66
type InstancePath ,
67
67
} from "~/shared/awareness" ;
68
68
import { updateWebstudioData } from "~/shared/instance-utils" ;
69
- import {
70
- computeExpression ,
71
- rebindTreeVariablesMutable ,
72
- } from "~/shared/data-variables" ;
69
+ import { rebindTreeVariablesMutable } from "~/shared/data-variables" ;
73
70
import { parseCurl , type CurlRequest } from "./curl" ;
74
71
75
72
export const parseResource = ( {
@@ -558,7 +555,7 @@ export const getResourceScopeForInstance = ({
558
555
const name = encodeDataVariableId ( dataSourceId ) ;
559
556
scope [ name ] = value ;
560
557
aliases . set ( name , dataSource . name ) ;
561
- variableValues . set ( dataSource . name , value ) ;
558
+ variableValues . set ( dataSourceId , value ) ;
562
559
}
563
560
}
564
561
}
@@ -621,7 +618,7 @@ export const useResourceScope = ({ variable }: { variable?: DataSource }) => {
621
618
const key = encodeDataVariableId ( variable . id ) ;
622
619
delete newScope [ key ] ;
623
620
newAliases . delete ( key ) ;
624
- newVariableValues . delete ( variable . name ) ;
621
+ newVariableValues . delete ( variable . id ) ;
625
622
}
626
623
return {
627
624
scope : newScope ,
@@ -798,7 +795,7 @@ const parseHeaders = (headers: Resource["headers"]) => {
798
795
const newHeaders = headers . filter ( ( header ) => {
799
796
// cast raw expression result to string
800
797
const value = String (
801
- computeExpression ( header . value , new Map ( ) )
798
+ evaluateExpressionWithinScope ( header . value , { } )
802
799
) . toLowerCase ( ) ;
803
800
if ( isCacheControl ( header . name ) ) {
804
801
// move simple header like Cache-Control: max-age=10 to dedicated input
@@ -1180,6 +1177,7 @@ export const GraphqlResourceForm = forwardRef<
1180
1177
}
1181
1178
} }
1182
1179
/>
1180
+ < input type = "hidden" name = "method" value = "post" />
1183
1181
1184
1182
< Grid gap = { 1 } >
1185
1183
< Label htmlFor = { queryId } > Query</ Label >
0 commit comments