# GraphQL API Request Syntax

**URL:** <https://community.postman.com/t/graphql-api-request-syntax/54761>\
**Category:** Help Hub\
**Tags:** api, graphql\
**Created:** [November 18, 2023, 7:12pm UTC](https://community.postman.com/t/graphql-api-request-syntax/54761 "2023-11-18T19:12:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![topstop](https://avatars.discourse-cdn.com/v4/letter/t/ac8455/32.png) [@topstop](https://community.postman.com/u/topstop)\
**Post date:** [November 18, 2023, 7:12pm UTC](https://community.postman.com/t/graphql-api-request-syntax/54761/1 "2023-11-18T19:12:17Z")

</div>

How is a value set against a sub field like status id and status name below?

```auto
{
  openOrders(limit: 10, tabName: "new") {
    orderID
    customerName
    status{
      id
      name
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [November 19, 2023, 10:26pm UTC](https://community.postman.com/t/graphql-api-request-syntax/54761/2 "2023-11-19T22:26:37Z")

</div>

Hey @topstop 👋

Welcome to the Postman community! :postman:

Could you share which API this is from or the documentation?

---

<div class="post-metadata">

**Author:** ![topstop](https://avatars.discourse-cdn.com/v4/letter/t/ac8455/32.png) [@topstop](https://community.postman.com/u/topstop)\
**Post date:** [November 21, 2023, 3:58pm UTC](https://community.postman.com/t/graphql-api-request-syntax/54761/3 "2023-11-21T15:58:22Z")

</div>

Thanks Danny,

I wrote a conditional expression to filter out records from the openRecord query that do not have a status.id of 8,9,10,  
entered into Tests as:

```auto
pm.test("Check status name", function () {
  const responseData = pm.response.json();
  const status = responseData.alertStatusID;
  pm.expect([8, 9, 10].includes(status) ? status.name : "Order").to.exist;
});

```

Test Result is Pass

But It does not actually filter so openRecord query still returns all records  
Where should this condition expression filter be placed?

API Documentation

Open Records:

- lastUpdate (String): filter by date string
- limit (Int): Number of records returned
- skip (Int): Skip a certain number of records
- tabName (String): filter by tab name: all, today, new, in process

Record Details:  
Input: ids: [ID]!  
Output: [Records]

Search Records by recordID, recordName:  
regex (String!): This parameter accepts a regular expression (regex) string as input.  
byOrder (Boolean!): true = recordID, false = recordName  
Output: [Records] - record details

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 21, 2023, 3:58pm UTC](https://community.postman.com/t/graphql-api-request-syntax/54761/4 "2023-12-21T15:58:36Z")

</div>

Closed on December 21, 2023, 3:58pm UTC

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