GraphQL node not passing variables

It would seem the GraphQL node is faulty in that it doesn’t pass along variables. Here’s what the designer says my variables are:

Here’s what the GraphQL server gets:

{
"type":"http-log",
"timestamp":"2020-11-18T16:54:31.707+0000",
"level":"error",
"detail":{
  "operation":{
    "user_vars":{"x-hasura-role":"admin"},
    "error":{
      "path":"$.variableValues",
      "error":"expecting a value for non-nullable variable: o of type: fivetran_connectors_insert_input! in variableValues",
      "code":"validation-failed"
    },
    "request_id":"6703726f-00b3-991f-a4d3-4235bdd3fb9f",
    "response_size":172,
    "query":{
      "variables":{},
      "operationName":"UpsertFivetranConnector",
      "query":"mutation UpsertFivetranConnector($o: fivetran_connectors_insert_input!) {\n  insert_fivetran_connectors_one(\n    object: $o, \n    on_conflict: {\n      constraint: connectors_pkey,\n      update_columns: [setup_state, data]\n    }) {\n    id\n  }\n}\n"}},
    "http_info":{
      "status":200,
      "http_version":"HTTP/1.1",
      "url":"/v1/graphql",
      "ip":"127.0.0.1",
      "method":"POST",
      "content_encoding":null
    }
  }
}

Note the distinct lack of variables passed along.

Definition:

    {
      "parameters": {
        "endpoint": "http://analytics-db-m2m/v1/graphql",
        "requestFormat": "json",
        "query": "mutation UpsertFivetranConnector($o: fivetran_connectors_insert_input!) {\n  insert_fivetran_connectors_one(\n    object: $o, \n    on_conflict: {\n      constraint: connectors_pkey,\n      update_columns: [setup_state, data]\n    }) {\n    id\n  }\n}\n",
        "variables": "={\n  \"o\": {\n    \"data\": \"{{JSON.stringify($json[\"data\"])}}\"\n    \"setup_state\": {{$json[\"data\"][\"status\"][\"setup_state\"]}},\n    \"remote_id\": {{$json[\"data\"][\"id\"]}}\n  }\n}",
        "operationName": "UpsertFivetranConnector",
        "headerParametersUi": {
          "parameter": [
            {
              "name": "x-hasura-admin-secret",
              "value": "={{ $env.LOGARY_M2M_HASURA_ADMIN_SECRET }}"
            }
          ]
        }
      },
      "name": "Insert Connector",
      "type": "n8n-nodes-base.graphql",
      "typeVersion": 1,
      "position": [
        940,
        130
      ]
    },

There’s a silent fail here:

Perhaps this could be logged?

Solved by extending the logging to say what’s wrong instead of silently overwriting my variables.

Great, thanks a lot. Got merged and will be released with the new version tomorrow.

1 Like