https://bz.apache.org/bugzilla/show_bug.cgi?id=65108

            Bug ID: 65108
           Summary: Passing a numeric variable to GraphQL HTTP Request
                    logs an error and doesn't send any variables.
           Product: JMeter
           Version: 5.4
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: a...@andylowry.me.uk
  Target Milestone: JMETER 5.4.1

Created attachment 37720
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37720&action=edit
Simple example for testing

Using the GraphQL HTTP Request sampler with Variables set like this:

{
        "number": ${number}
}

(Note no " around the value)

Results in the following error:

2021-01-26 17:07:23,695 ERROR o.a.j.p.h.u.GraphQLRequestParamUtils: Ignoring
the GraphQL query variables content due to the syntax error: Unrecognized token
'$': was expecting (JSON String, Number, Array, Object or token 'null', 'true'
or 'false')
 at [Source: (String)"{
        "number": ${number}
}
"; line: 2, column: 13]

And the POST Data is missing the variables:

POST data:
{"operationName":"Test","query":"query Test() {\n\t\n}"}

Adding quotes gives the expected behaviour:

POST data:
{"operationName":"Test","variables":{"number":"0"},"query":"query Test()
{\n\t\n}"}

But the value is now passed as a string instead of a number, so is not the
correct request.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to