diff --git a/cookbook/specs/spec_add_sqdsubgraph.json b/cookbook/specs/spec_add_sqdsubgraph.json index fc527b78b5..b535e5a76d 100644 --- a/cookbook/specs/spec_add_sqdsubgraph.json +++ b/cookbook/specs/spec_add_sqdsubgraph.json @@ -70,12 +70,12 @@ { "name": "health", "parse_directive": { - "function_template": "/subgraphs/name/1", + "function_template": "{\"query\":\"{\n pools(first: 5) {\n id\n poolid\n platform {\n id\n }\n name\n }\n}\"}", "function_tag": "VERIFICATION", "result_parsing": { "parser_arg": [ "0", - "message" + "error" ], "parser_func": "PARSE_CANONICAL" }, @@ -83,7 +83,7 @@ }, "values": [ { - "expected_value": "Body is required" + "expected_value": "GraphQL server error (client error): Invalid subgraph name \"1\"" } ] } diff --git a/protocol/chainlib/rest.go b/protocol/chainlib/rest.go index 2cb687ba55..813219568c 100644 --- a/protocol/chainlib/rest.go +++ b/protocol/chainlib/rest.go @@ -44,8 +44,15 @@ func (bcp *RestChainParser) GetUniqueName() string { func (apip *RestChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error) { if craftData != nil { + var data []byte = nil + urlPath := string(craftData.Data) + if craftData.ConnectionType == http.MethodPost { + // on post we need to send the data provided in the templace with the api as method + data = craftData.Data + urlPath = craftData.Path + } // chain fetcher sends the replaced request inside data - chainMessage, err := apip.ParseMsg(string(craftData.Data), nil, craftData.ConnectionType, metadata, 0) + chainMessage, err := apip.ParseMsg(urlPath, data, craftData.ConnectionType, metadata, 0) if err == nil { chainMessage.AppendHeader(metadata) } diff --git a/protocol/parser/parser.go b/protocol/parser/parser.go index dcd53001cd..e613e0337e 100644 --- a/protocol/parser/parser.go +++ b/protocol/parser/parser.go @@ -79,10 +79,11 @@ func ParseFromReply(rpcInput RPCInput, blockParser spectypes.BlockParser) (strin } if strings.Contains(response, "\"") { - response, err = strconv.Unquote(response) + responseUnquoted, err := strconv.Unquote(response) if err != nil { - return "", err + return response, nil } + return responseUnquoted, nil } return response, nil diff --git a/x/protocol/types/params.go b/x/protocol/types/params.go index 615ffb748d..58f968de99 100644 --- a/x/protocol/types/params.go +++ b/x/protocol/types/params.go @@ -12,7 +12,7 @@ import ( var _ paramtypes.ParamSet = (*Params)(nil) const ( - TARGET_VERSION = "0.30.2" + TARGET_VERSION = "0.30.3" MIN_VERSION = "0.27.1" )