This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Combine | |
class FilterState: ObservableObject { | |
@Published var filterId: String? | |
@Published var hasFilter: Bool = false | |
init() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import CoreLocation | |
struct ContentView: View { | |
//Get the networking controller from the environment objects. | |
@EnvironmentObject var networkingController: ApolloNetworkingController | |
//Do the same with the location controller even though we could access this controller as a property of the network controller. | |
@EnvironmentObject var locationController: LocationController | |
//Swift UI Magic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApolloNetworkingController: ObservableObject { | |
@Published var businesses: [BusinessFragment] = [] | |
@Published var businessesQueryRunning: Bool = false | |
@Published var businessesQueryError: Error? | |
@Published var searchText: String = "Food" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>yelp.com</key> | |
<dict> | |
<key>NSExceptionAllowsInsecureHTTPLoads</key> | |
<false/> | |
<key>NSIncludesSubdomains</key> | |
<true/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ApolloCodegenLib | |
import FileProvider | |
let parentFolderOfScriptFile = FileFinder.findParentFolder() | |
//1) Get some directory references | |
//This is the directory that the entire project lives in. | |
let projectDirectory = parentFolderOfScriptFile.deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent() | |
//This is the directory for the Codegen | |
let codegenDirectory = projectDirectory.appendingPathComponent("Codegen") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PackageDescription | |
let package = Package( | |
name: "Codegen", | |
dependencies: [ | |
// Dependencies declare other packages that this package depends on. | |
.package(name: "Apollo", url: "https://github.com/apollographql/apollo-ios.git", .upToNextMinor(from: "0.25.0")) | |
], | |
targets: [ | |
// Targets are the basic building blocks of a package. A target can define a module or a test suite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query Businesses($searchTerm: String, $latitude: Float, $longitude: Float) { | |
search(term: $searchTerm, latitude: $latitude, longitude: $longitude) { | |
business { | |
...BusinessFragment | |
} | |
} | |
} | |
fragment BusinessFragment on Business { | |
id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apollo schema:download --endpoint https://api.yelp.com/v3/graphql --header 'Authorization: Bearer <API KEY>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RDSSecurityGroup: | |
Type: 'AWS::EC2::SecurityGroup' | |
Properties: | |
GroupName: !If ['IsProduction', 'api_rds', !Sub 'api_rds_${ENV}'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RouteTableAPublic: | |
Type: 'AWS::EC2::RouteTable' | |
Properties: | |
VpcId: !Ref VPC | |
Tags: | |
- Key: Name | |
Value: !Sub 'Route Table public A - ${ENV}' |
NewerOlder