Example of how to use Fragment in GQL within Fluent. We will be using fulfilments
Author:
Fluent Commerce
Changed on:
13 Dec 2023
Key Points
- Example on how to use fragments in GQL
Steps
Here is the standard query GQL to get the fulfilment data:

returning result

create fragment for the order

GQL with fragment returning result

As you can see from the result, the order fields are now replaced with "fromFragment". this is showing that the data is now coming from the fragment
Nested Fragments

nested Fragment result
