GraphQL Requests problems


#1

Hi I’m working on finding how to make request with graphql.
I’m using the interface for testing my request.

First problem i am having is when i use any request with viewer, it always returns Null

{
viewer {
userName
lastName
firstName
email
}
}
=> null

Second problem is i want to get the last ten request with a filter on a data of the workflow.

So something like that for getting all the requests opened with a data named “city” and a value “Lausanne”:

{
user(userName: “MyUser”) {
lastName
firstName
email
requests(
filter: {as: SUPERVISOR},
orderBy: {field: OPENED_AT, direction: DESC},
page: {number: 1, size: 20})

  {
  hasNextPage
  hasPreviousPage
  totalCount
  items {
    description
    followUpFormPortalUrl
    followUpFormUrl
  dataset 
    {
      items
      {
        name = "CITY"
        textValue = "Lausanne"
      }
    
    }
  
  }
}

}
}

Is it possible?


#2

Hi @devgresham,

  1. What version of WorkflowGen are you using? The viewer query is working fine on my end.

  2. Process data filtering is not available yet with GraphQL but it is on the roadmap for a future release. We will keep you updated on when this feature will be released.

For now, what you can do is retrieve all requests with the specific process data value. Then in code behind you can filter the results by checking if the value is equal to “Lausanne”
Here is an example:

{
  requests(page: {size: 50}, filter: {processName: "PROCESS_NAME"}) {
    totalCount
    items {
      number
      
      dataset(filter:{names:["City"]}) {
        items {
          textValue
        }
      }
    }
  }
  }

Regards,
Eddy.


#3

Ok I’m using version 7.1.1.

The attribute processName in filter attributes is not accessible. I’ve only access to as, status and isTest.
So for the moment, i will have to get all the data and filter in code behind after.


#4

Hi @devgresham,

I recommend you upgrading to the latest version to get the latest features of GraphQL. A lot of new parameters have been added since 7.1.1.

Regards,
Eddy.