getPageByHandle method

Future<Page> getPageByHandle(
  1. String handle
)

Returns a Page.

Returns the Page that is associated to the handle.

Implementation

Future<Page> getPageByHandle(String handle) async {
  final QueryOptions _options = WatchQueryOptions(
    document: gql(getPageByHandleQuery),
    variables: {
      'handle': handle,
    },
    fetchPolicy: ShopifyConfig.fetchPolicy,
  );
  final QueryResult result = await _graphQLClient!.query(_options);
  checkForError(result);
  var response = result.data!['pageByHandle'];
  return Page.fromJson(response);
}