I want null values for entites during run time query

Hi Team,

I am working on graphQL APIs and writing regression scripts in postman.

I am giving sample of my project query in request body and variables json body below.

query CustomerDetails($customerId: Int!, $accountNumbers: [String!], $customerName: String) {
  customer(id: $customerId
           accountNumber: $accountNumbers
           customerName: $customerName
  ) {
    id
    name: customerName
    accountNumbers: accountNumbers
    loanTypes
    
  }
}

GraphQL variables body is:

{
  "customerId": {{id}},
  "accountNumbers": ["{{accnum}}"],
  "customerName": "{{name}}"
}

Here I am passing data from csv file. In negative testcases I want to set accountNumbers: null , customerName: null in graphQl variables. But here when data driven from csv file for failure testcases it is not accepting null and null is taking as a String. Is that possible we can directly set data to request body.

Here I want to replace entire array with null in the graphQL variables. Is there any chance that if we are getting null from the csv data file we can directly set the value in the request query during run time.

Everyone Please help me.

Is this a follow on question from this one?

Yes, please help me. I want to replace account Number array in the query variables with null. Please help me with this.

That approach is not working for graphQl. So that’s why I have reposted with complete problem.

Please help me @danny-dainton

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.