getAllPages method
Future<List<Page> ?>
getAllPages({
- SortKeyPage sortKeyPage = SortKeyPage.ID,
- bool reversePages = false,
- String? pagesQuery,
Implementation
Future<List<Page>?> getAllPages({
SortKeyPage sortKeyPage = SortKeyPage.ID,
bool reversePages = false,
String? pagesQuery,
}) async {
final WatchQueryOptions _options = WatchQueryOptions(
document: gql(getAllPagesQuery),
variables: {
'reversePages': reversePages,
'sortKey': sortKeyPage.parseToString(),
'pagesQuery': pagesQuery,
},
fetchPolicy: ShopifyConfig.fetchPolicy,
);
final QueryResult result = await _graphQLClient!.query(_options);
checkForError(result);
return (Pages.fromGraphJson((result.data ?? const {})["pages"] ?? const {}))
.pageList;
}