Skip to content

A rick and morty app, made to experiment with Graphql and the Apollo Client

Notifications You must be signed in to change notification settings

LighteningCode/rick-and-morty-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rick and Morty Character app

Rick and Morty

So I did a quick project with the rick and morty API here using apollo client to consume a graphql API with this

What did I learn?

  1. I learnt that when using FlatLists in react native the object returned from the renderItem prop is an object with two properties item and index, and the only way to change it is to use this (check line 191 in App.js)
renderItem={({ item:new_name, index }) => <EpisodeItem episode={new_name.episode} airdate={new_name.air_date} name={new_name.name} />}

otherwise you must use it the way it was

renderItem={({ item, index }) => <EpisodeItem episode={item.episode} airdate={item.air_date} name={item.name} />}

This was the most eye opening frustration of the day.

  1. I learnt how to use apollo client to pass a variable through the grapql query statement (App.js - line 127&128)

  2. Learnt that ReactNative refresh control does not work outside the FlatList component

  3. Attempted to use the FluidNavigation to transition between screens and it didnt work, i tried thier examples, they also didnt work, looks like a dependency was removed from somewhere inside

🎉🎉 Clone repo and run on expo to take a look

About

A rick and morty app, made to experiment with Graphql and the Apollo Client

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published