GQL @skip @include Directives sample
Essential knowledge
Author:
Fluent Commerce
Changed on:
2 Feb 2024
Overview
Sample GQL payload to use @skip and @include directives
Key points
- Sample query for @skip and @include
Query
1query ($includeItems: Boolean!, $skipItems: Boolean!) {
2 orders (ref:"%5"){
3 edges{
4 node{
5 id
6 ref
7 IncludeTest:items @include(if: $includeItems){
8 edges{
9 node{
10 status
11 }
12 }
13 }
14 SkipTest:attributes @include(if: $skipItems){
15 name
16 value
17 }
18 }
19 }
20 }
21}
Language: json
Name: sample query
Description:
[Warning: empty required content area]Input Variable:
1{
2 "includeItems": false,
3 "skipItems": true
4}
Language: json
Name: input variable - sample query
Description:
[Warning: empty required content area]