laravel-graphql icon indicating copy to clipboard operation
laravel-graphql copied to clipboard

Variable of type string

Open drmax24 opened this issue 6 years ago • 2 comments

I've figured out how to pass variables of custom input types. But i cant pass variable of a standard type String. Is it a bug?


{
  "data": null,
  "errors": [
    {
      "message": "Variable \"$pdf_uri\" of type \"String\" used in position expecting type \"String!\".",
      "locations": [
        {
          "line": 1,
          "column": 10
        },
        {
          "line": 1,
          "column": 235
        }
      ]
    }
  ]
}

It says I use String but it is expecting String. This why i have error.

drmax24 avatar Apr 03 '18 21:04 drmax24

@drmax24 it is expecting a non-null string. Could it be that you misdefined your variable?

crisu83 avatar Apr 04 '18 09:04 crisu83

myhost.com/graphiql?query=mutation($pdf_uri:String) {
  car_tyres_order(car_tyre_ids:["a009fcf0-2dbb-11e8-a027-f72def6513e9","a0d5e9d0-2dbb-11e8- 9755-65c37584f4dd","a0d23750-2dbb-11e8-a3b4-fff16c7058b2"],
  client_name:"Тест",
  client_email:"[email protected]",
  pdf_uri:$pdf_uri)
  {car_tyre_order_id}}&wkhtmltopdf-params[margin-bottom]=0&wkhtmltopdf-params[margin-left]=0&wkhtmltopdf-params[margin-right]=0&wkhtmltopdf-params[margin-top]=0&wkhtmltopdf-params[viewport-size]=980x1024&wkhtmltopdf-params[window-status]=ready-to-print&pdf_file_name=шины&data=[{"id":"a009fcf0-2dbb-11e8-a027-f72def6513e9","count":1},{"id":"a0d5e9d0-2dbb-11e8-9755-65c37584f4dd","count":2},{"id":"a0d23750-2dbb-11e8-a3b4-fff16c7058b2","count":1}]"){car_tyre_order_id}}&variables={
"pdf_uri": "ss"
}

see pdf_uri variable

drmax24 avatar Apr 04 '18 10:04 drmax24