Flutter Starter

Flutter Starter

  • Docs
  • Roadmap
  • Github
  • Hire The Creators

›API SDK

Introduction

  • Getting started
  • Motivation
  • Installation
  • Editor setup
  • Folder structure

Styleguide

  • Add image assets
  • Add fonts assets
  • Add splash screen
  • Add color constants
  • Add theme data

Build the app

  • Add routers
  • Add dependencies

API SDK

  • API SDK overview
  • API SDK REST
  • API SDK GraphQL

State management

  • Shared overview
  • Add models
  • Add resources
  • Add BLoC

Sample apps

  • HackerNews App
  • GithubRepo List App
  • Weather App
  • Bookstore App

Test

  • Add test files

Deployment

  • Deployment

Firebase Setup Guide

  • For Android
  • For iOS

API SDK GraphQL

For all the GraphQL operations, there is a folder named graphql_operation which contains all the queries. graphql_handler.dart is used to handle this and it contains all the functions to query or mutate a client.

In api_constants.dart, set the GraphQLClient with _httpLink and _authLink. Next, in the main.dart file for API SDK, call a function to get the data. For example, there is a function for accessing Github repositories:

static fetchGithubRepoGraphQl(numOfRepositories) async {
    final GraphqlQlHandler githubRepository =
        GraphqlQlHandler(client: client());
    final response = await githubRepository.getRepositories(numOfRepositories);

    return response;
  }

The client() comes from api_constants.dart.

Use the following to call the function:

ApiSdk.fetchGithubRepoGraphQl(10);
← API SDK RESTShared overview →
Docs
Getting StartedExamples
Community
TwitterDiscord
More
GitHubContribution Guidelines
Stars
Built with ❤️  at GeekyAnts.
Copyright © 2021 Flutter Starter