A very simple Rick & Morty app to demo GraphQL + SwiftUI

Related tags

SwiftUI App MortyUI
Overview

MortyUI

A very simple Rick & Morty app to demo GraphQL + SwiftUI

Characters Character detail Episode

This app have a very simple SwiftUI MVVM architecture.

Each views have its own view model which consist of running a simple GraphQL query to fetch the necassary data. Once the data is set in the @Published property of the view model, the data will be displayed in the view. While it's fetching the data, it'll use the powerful SwiftUI .redacted placeholder modifier to display a beautiful loading state.

All the queries are in Queries.graphql. The file API.swift is generated at the build time using the schema.json of the GraphQL API of this awesome Rick & Morty API website and the Queries.graphql file using the Apollo CLI

For now you can browse characters, episodes and locations (soon). Search is coming soon.

To not slow the build process, this project is coming with a Swift package command line tool to generate the swift code using the new Apollo Swift scripting feature. It can also download the schema from the Rick & Morty API.

It's not executed as part of the build process, if you modify the queries and wish to regenerate the API.swift file you'll need to:

cd Codegen

swift run Codegen codegen

and to download the schema

swift run Codegen download

This is all an excercice for me to play a bit with GraphQL + SwiftUI. Nothing very exciting on the UI side. The exiting part is that it's actually very little code (just the UI code + some GraphQL queries) to have the app working.

You might also like...
A demo of how you can integrate SwiftUI and Airtable in your app
A demo of how you can integrate SwiftUI and Airtable in your app

SwiftUI Airtable Demo This is a small, functional example app that demonstrates how you can use Airtable as a lightweight backend. I wouldn't recommen

A demo app to showcase testable, modern iOS development with SwiftUI and Combine on MVVM-C architecture.

Coinz_App_iOS A demo app to showcase testable, modern iOS development with SwiftUI and Combine on MVVM-C architecture. Tech Stack: Swift, SwiftUI, Com

A directory demo app written with SwiftUI, Core Data, and Alamofire
A directory demo app written with SwiftUI, Core Data, and Alamofire

Directory-SwiftUI A directory demo app written with SwiftUI, Core Data, and Alamofire Getting Started Clone (or fork) this repo: git clone git@github.

Booky heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS 16
Booky heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS 16

Booky Demo App ℹ️ ABOUT Booky is a work-in-progress, heavily-commented demo app built to explore Apple's new 'App Intents' framework introduced in iOS

SwiftWebUI - A demo implementation of SwiftUI for the Web
SwiftWebUI - A demo implementation of SwiftUI for the Web

SwiftWebUI More details can be found on the related blog post at the Always Right Institute. At WWDC 2019 Apple announced SwiftUI. A single "cross pla

COVID-19 SwiftUI Demo
COVID-19 SwiftUI Demo

COVID-19_SwiftUI_Demo About COVID-19_SwiftUI_Demo is the coronavirus information application using SwiftUI which is first introduced in WWDC19 keynote

demo: REST API with SwiftUI
demo: REST API with SwiftUI

CatAPISwiftUI demo: REST API with SwiftUI The example API is the cat API. https://thecatapi.com/ You can watch me develope this code on my Youtube cha

Demo implementing Modern MVVM with Combine and SwiftUI

ModernMVVM-Combine-SwiftUI Demo implementing Modern MVVM with Combine and SwiftUI Includes the following: Publishers feedback with needed extensions V

Demo to show Air Quality Indices of Cities (in India) using SwiftUI and Combine Framework

AirQualityMonitoring-SwiftUI-Combine Demo to show Air Quality Indices of Cities (in India) using SwiftUI and Combine Framework Demo Video City List wi

Comments
  • Data re-fetching unexpected

    Data re-fetching unexpected

    Switching the tab bar item will cause data fetching, and the result is that some characters (or episodes etc.) will be listed more than once.

    .onAppear { data.fetchCharacters() }

    I fixed this problem by adding more condition... not sure if it is elegant...

    opened by linhongye 0
  • fix: unredacted some section header

    fix: unredacted some section header

    I put the title of some sections not to be the skeleton. Like Info, Locations etc

    Maybe we can write a more general way to reduce the duplicate code 🤔

    opened by thoamsy 0
Owner
Thomas Ricouard
[Entrepreneur, iOS/Mac & Web dev] Work @Medium / @Glose Past: @google, Co-Founded @MySeeen (Share movies !) @RobinBrowser (The smart Browser).
Thomas Ricouard
Red Torch is a very very (very) simple iOS app that allows you to have a red torch using your screen.

RED Torch Red Torch is a very very (very) simple iOS app that allows you to have a red torch using your screen. The App is based on storyboard, so the

Jakub 0 Jan 1, 2022
A simple App to Track the status of Covid-19 around the World. Using SwiftUI and GraphQL

CovidUI CovidUI is a simple App to Track the status of Covid-19 around the World. This is a simple App I made to track the spread of Covid-19 for me a

Mathias Quintero 77 Dec 14, 2022
An Elden Ring companion app using SwiftUI + GraphQL

The Roundtable The bustling hub area that exists outside of the Lands Between. A place to mingle with other adventurerers, craftsmen, resupply and dis

Thomas Ricouard 45 Sep 25, 2022
Tutorial GraphQL + Node Express + MySQL, and sample for Android / iOS client

GraphQL-tutorial Tutorial for GraphQL + Node Express + MySQL, and sample for Android / iOS client Blog NeoRoman's GraphQL-tutorial (Korean) Materials

Henry Kim 4 Oct 20, 2022
A very simple To Do app to illustrate the principles from my A Better MVC talk

MVC Todo For more background on this repository, please consider reading these blog posts: https://davedelong.com/blog/tags/a-better-mvc/ What this sa

Dave DeLong 443 Jan 4, 2023
📱 Very simple and lightweight messenger using Firebase

?? Very simple and lightweight messenger using Firebase ??. It is a training project for the practice of MVVM architecture.

Daniel Tvorun 2 Jun 26, 2022
IOS15-SwiftUI-InAppPurchaseDemo - In-App Purchase Demo app written with SwiftUI

iOS15-SwiftUI-InAppPurchaseDemo In-App Purchase Demo app written with SwiftUI If

null 5 Jul 20, 2022
Droplet is a very small SwiftUI application that runs in the menubar and allows a file to be dropped onto the popover.

A Mac OS menubar application that allows drag-and-drop file uploading to an S3 bucket with a presigned URL copied to the clipboard. Work in progress.

Josh McArthur 11 Sep 8, 2022
In this tutorial, you’ll write your very first Core Data application with SwiftUI in Xcode

TodoApp-IOS In this tutorial, you’ll write your very first Core Data application with SwiftUI in Xcode. You’ll see how easy it is to get started with

Noye Samuel 1 Dec 13, 2021
A SwiftUI system components and interactions demo app

SwiftUI Kit A SwiftUI system components and interactions demo app based on iOS 14, macOS Big Sur, watchOS 7, and tvOS 14. Use the SwiftUI Kit app to s

Jordan Singer 2k Jan 6, 2023