Custom Resolver Variable Substitution Issue

Dgraph Version

v20.11.2

Expected Behavior and Actual Result

When calling a custom resolver I expect the variables referenced in the URL by $var to be replaced by the value passed in to the resolver. This is working properly for the getData1 and getData2 resolvers below, but does not work for the getData3 resolver. The only difference is a slight change in the URL format.

GraphQL schema

type Response @remote {
        data: String
}

type Query {
        getData1(uuid: String!): Response @custom(http:{
                url: "http://192.168.40.24:10080/data1/$uuid"
                method: GET
        })
        getData2(uuid: String!): Response @custom(http:{
                url: "http://192.168.40.24:10080/data2?q=$uuid"
                method: GET
        })
        getData3(uuid: String!): Response @custom(http:{
                url: "http://192.168.40.24:10080/data3?q=UUID:$uuid"
                method: GET
        })
}

Query

{
  getData1(uuid: "foo") {
    data
  }
  getData2(uuid: "foo") {
    data
  }
  getData3(uuid: "foo") {
    data
  }
}

Netcat log

GET /data1/foo HTTP/1.1
Host: 192.168.40.24:10080
User-Agent: Go-http-client/1.1
Content-Type: application/json
Accept-Encoding: gzip

GET /data2?q=foo HTTP/1.1
Host: 192.168.40.24:10080
User-Agent: Go-http-client/1.1
Content-Type: application/json
Accept-Encoding: gzip

GET /data3?q=UUID%3A%24uuid HTTP/1.1
Host: 192.168.40.24:10080
User-Agent: Go-http-client/1.1
Content-Type: application/json
Accept-Encoding: gzip
1 Like