-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(planner-advert): setup data layer
1 parent
3a66dac
commit 27dbab4
Showing
4 changed files
with
1,487 additions
and
1,431 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
lib/features/planner_advert/repository/getPlannerAdvertContent.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
query GetPlannerAdvertContent { | ||
PlannerAdvert { | ||
isEnabled, | ||
title, | ||
description, | ||
url | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
lib/features/planner_advert/repository/planner_advert_repository.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import "package:flutter_riverpod/flutter_riverpod.dart"; | ||
import "package:riverpod_annotation/riverpod_annotation.dart"; | ||
|
||
import "../../../api_base/query_adapter.dart"; | ||
import "../../../config/ttl_config.dart"; | ||
import "getPlannerAdvertContent.graphql.dart"; | ||
|
||
part "planner_advert_repository.g.dart"; | ||
|
||
typedef PlannerAdvertContent = Query$GetPlannerAdvertContent$PlannerAdvert; | ||
|
||
@riverpod | ||
Future<PlannerAdvertContent?> plannerAdvertContentRepository(Ref ref) async { | ||
final results = await ref.queryGraphql( | ||
Options$Query$GetPlannerAdvertContent(), | ||
TtlKey.plannerAdvertRepository, | ||
); | ||
|
||
return results?.PlannerAdvert; | ||
} |