Playground for TopshotGraphQL
- cd to base folder
- if you have never install cocoapods, run
brew install cocoapods
- run
pod install
to install dependencies - open the workspace file
TG.workspace
instead of the project file to open Xcode after step 3 is done
Installing Apollo (1.1.3)
Installing RxSwift (6.5.0)
Apollo is chosen to be the one to handle GraphQL request, response objects and services RxSwift is chosen to help implement MVVM
- Schema downloading run
apollo schema:download --endpoint=https://public-api.nbatopshot.com/graphql schema.json
- Init config for auto gen
run
./Pods/Apollo/apollo-ios-cli init --schema-namespace TG --module-type other --target-name TG --path './TG/API.swift'
- New query can be added to TG/GraphQL.graphql
run
.Pods/Apollo/apollo-ios-cli generate
to update schema after new Queries are created.