How mainawycliffe/graphql_flutter_bloc_example works
Project type and purpose
• This is a Flutter mobile-app example (Android & iOS) demonstrating how to integrate the GitHub GraphQL API with Flutter using the graphql client library and flutter_bloc for state management.
• The app’s purpose is to fetch a user’s repositories, display them, and provide star/unstar functionality via GraphQL queries and mutations.
File structure
• Top-level Flutter platform folders: android/ and ios/ (native project files, build scripts, manifests, xcworkspace, Gradle wrappers).
• The core app lives in lib/:
• main.dart – app entry point; initializes GraphQL client and BlocProviders.
• blocs/repos/ – business-logic components: events, states, and the MyReposBloc.
• graphql_operation/queries and graphql_operation/mutations – GraphQL documents for reading repos and (un)starring.
• repository.dart – a wrapper that uses the GraphQL client to execute operations and convert raw responses into models.
• There’s no custom backend code—only an external dependency on GitHub’s GraphQL API.
README for additional insights
• Requires a local.dart in lib/ exporting your GitHub personal access token constant.
• Confirms use of graphql (core GraphQL client) and flutter_bloc for separation of UI and business logic.