4.1.2 Пример выполнения запроса с параметрами
|
# Выполнение запроса с параметрами
$text = 'mutation SaveBlob($fileId1: String!, $filename1: String!) {
create1: createRefFile (input:
{
clientMutationId:"sid",
data: {
isnObject: 4377,
refFileTypeName: "RefFilePrj",
contents: $fileId1,
description: $filename1
}
}
)
{
success
message
messageCode
}
}'
$vars = '{ "fileId1": "$fileId1", "filename1": "$filename1" }'
$operName = 'Save'
$json = @{query = $text; variables = $null; operationName = $operName; } | ConvertTo-Json
$Response = Invoke-WebRequest -Uri "$BaseUrl/CoreHost/gql/query" -Body $json -Method 'POST' -WebSession $Session -ContentType "application/json; charset=utf-8"
|
Далее в примерах будем рассматривать только формирование текста запроса без параметров, а не полный json запросов.
