Skip to content

Instantly share code, notes, and snippets.

@ArturBaybulatov
Created August 11, 2017 11:50
Show Gist options
  • Select an option

  • Save ArturBaybulatov/9f8efdaef85ed3ec9c857fde20d2892d to your computer and use it in GitHub Desktop.

Select an option

Save ArturBaybulatov/9f8efdaef85ed3ec9c857fde20d2892d to your computer and use it in GitHub Desktop.

Query:

{
  brands(luxury: true) {
    edges {
      node {
        name
        luxury
        
        products(quantity: 0) {
          edges {
            node {
              name
              quantity
            }
          }
        }
      }
    }
  }
}

Result:

{
  "data": {
    "brands": {
      "edges": [
        {
          "node": {
            "name": "Brand-10",
            "luxury": true,
            "products": {
              "edges": []
            }
          }
        },
        {
          "node": {
            "name": "Brand-2",
            "luxury": true,
            "products": {
              "edges": []
            }
          }
        },
        {
          "node": {
            "name": "Brand-4",
            "luxury": true,
            "products": {
              "edges": []
            }
          }
        },
        {
          "node": {
            "name": "Brand-7",
            "luxury": true,
            "products": {
              "edges": [
                {
                  "node": {
                    "name": "Product-12",
                    "quantity": 0
                  }
                }
              ]
            }
          }
        },
        {
          "node": {
            "name": "Brand-8",
            "luxury": true,
            "products": {
              "edges": []
            }
          }
        },
        {
          "node": {
            "name": "Brand-9",
            "luxury": true,
            "products": {
              "edges": []
            }
          }
        }
      ]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment