diff --git a/.swiftlint.yml b/.swiftlint.yml index 57b5d178..c8098c97 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,6 +1,7 @@ disabled_rules: # rule identifiers to exclude from running - variable_name - nesting +- line_length - function_parameter_count opt_in_rules: # some rules are only opt-in - control_statement diff --git a/Fitness.xcodeproj/project.pbxproj b/Fitness.xcodeproj/project.pbxproj index a1b248a0..8d1afbec 100644 --- a/Fitness.xcodeproj/project.pbxproj +++ b/Fitness.xcodeproj/project.pbxproj @@ -63,6 +63,7 @@ C7EBD5AE2062E73C00D76A8B /* ClassListHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7EBD5AD2062E73C00D76A8B /* ClassListHeaderView.swift */; }; C7EBD5B02062F14D00D76A8B /* Montserrat-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C7EBD5AF2062F14D00D76A8B /* Montserrat-Regular.ttf */; }; C7EBD5B32062FDEB00D76A8B /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7EBD5B22062FDEB00D76A8B /* SearchBar.swift */; }; + D91565C92165686400BCA466 /* tagQueries.graphql in Resources */ = {isa = PBXBuildFile; fileRef = D91565C82165686400BCA466 /* tagQueries.graphql */; }; D94BD3082159DA9200C9214E /* classQueries.graphql in Resources */ = {isa = PBXBuildFile; fileRef = D94BD3072159DA9200C9214E /* classQueries.graphql */; }; /* End PBXBuildFile section */ @@ -128,6 +129,7 @@ C7EBD5AD2062E73C00D76A8B /* ClassListHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassListHeaderView.swift; sourceTree = ""; }; C7EBD5AF2062F14D00D76A8B /* Montserrat-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Montserrat-Regular.ttf"; sourceTree = ""; }; C7EBD5B22062FDEB00D76A8B /* SearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = ""; }; + D91565C82165686400BCA466 /* tagQueries.graphql */ = {isa = PBXFileReference; lastKnownFileType = text; path = tagQueries.graphql; sourceTree = ""; }; D94BD3072159DA9200C9214E /* classQueries.graphql */ = {isa = PBXFileReference; lastKnownFileType = text; path = classQueries.graphql; sourceTree = ""; }; /* End PBXFileReference section */ @@ -326,6 +328,7 @@ children = ( D94BD3072159DA9200C9214E /* classQueries.graphql */, 8D6B2A18215B23DC00807544 /* gymQueries.graphql */, + D91565C82165686400BCA466 /* tagQueries.graphql */, ); path = graphql; sourceTree = ""; @@ -348,11 +351,11 @@ buildPhases = ( 9BD15CB1CD033C4DBE57E681 /* [CP] Check Pods Manifest.lock */, 0C3AC6132155BF5100761495 /* Generate Apollo GraphQL API */, + 1CEB3B0B21503E5100BB5B61 /* Run SwiftLint */, C7DFABC7204206E000545B0B /* Sources */, C7DFABC8204206E000545B0B /* Frameworks */, C7DFABC9204206E000545B0B /* Resources */, 7B68B6796476F8A7F1E6B485 /* [CP] Embed Pods Frameworks */, - 1CEB3B0B21503E5100BB5B61 /* Run SwiftLint */, 8D29EFD320431FCA005B1CC8 /* Run Fabric build */, ); buildRules = ( @@ -404,6 +407,7 @@ buildActionMask = 2147483647; files = ( D94BD3082159DA9200C9214E /* classQueries.graphql in Resources */, + D91565C92165686400BCA466 /* tagQueries.graphql in Resources */, 8D26DB0B2072C31500144BFC /* Lato-Black.ttf in Resources */, 8D5EA47B208ED6E700E98E6C /* Lato-Bold.ttf in Resources */, C7EBD5B02062F14D00D76A8B /* Montserrat-Regular.ttf in Resources */, @@ -449,7 +453,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; + shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; 7B68B6796476F8A7F1E6B485 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; diff --git a/Fitness/API.swift b/Fitness/API.swift index dcfeddf2..c0a1dc06 100644 --- a/Fitness/API.swift +++ b/Fitness/API.swift @@ -349,6 +349,115 @@ public final class AllClassNamesQuery: GraphQLQuery { } } +public final class GetTagsQuery: GraphQLQuery { + public let operationDefinition = + "query GetTags {\n classes {\n __typename\n details {\n __typename\n tags\n }\n }\n}" + + public init() { + } + + public struct Data: GraphQLSelectionSet { + public static let possibleTypes = ["Query"] + + public static let selections: [GraphQLSelection] = [ + GraphQLField("classes", type: .list(.object(Class.selections))), + ] + + public private(set) var resultMap: ResultMap + + public init(unsafeResultMap: ResultMap) { + self.resultMap = unsafeResultMap + } + + public init(classes: [Class?]? = nil) { + self.init(unsafeResultMap: ["__typename": "Query", "classes": classes.flatMap { (value: [Class?]) -> [ResultMap?] in value.map { (value: Class?) -> ResultMap? in value.flatMap { (value: Class) -> ResultMap in value.resultMap } } }]) + } + + public var classes: [Class?]? { + get { + return (resultMap["classes"] as? [ResultMap?]).flatMap { (value: [ResultMap?]) -> [Class?] in value.map { (value: ResultMap?) -> Class? in value.flatMap { (value: ResultMap) -> Class in Class(unsafeResultMap: value) } } } + } + set { + resultMap.updateValue(newValue.flatMap { (value: [Class?]) -> [ResultMap?] in value.map { (value: Class?) -> ResultMap? in value.flatMap { (value: Class) -> ResultMap in value.resultMap } } }, forKey: "classes") + } + } + + public struct Class: GraphQLSelectionSet { + public static let possibleTypes = ["ClassType"] + + public static let selections: [GraphQLSelection] = [ + GraphQLField("__typename", type: .nonNull(.scalar(String.self))), + GraphQLField("details", type: .object(Detail.selections)), + ] + + public private(set) var resultMap: ResultMap + + public init(unsafeResultMap: ResultMap) { + self.resultMap = unsafeResultMap + } + + public init(details: Detail? = nil) { + self.init(unsafeResultMap: ["__typename": "ClassType", "details": details.flatMap { (value: Detail) -> ResultMap in value.resultMap }]) + } + + public var __typename: String { + get { + return resultMap["__typename"]! as! String + } + set { + resultMap.updateValue(newValue, forKey: "__typename") + } + } + + public var details: Detail? { + get { + return (resultMap["details"] as? ResultMap).flatMap { Detail(unsafeResultMap: $0) } + } + set { + resultMap.updateValue(newValue?.resultMap, forKey: "details") + } + } + + public struct Detail: GraphQLSelectionSet { + public static let possibleTypes = ["ClassDetailType"] + + public static let selections: [GraphQLSelection] = [ + GraphQLField("__typename", type: .nonNull(.scalar(String.self))), + GraphQLField("tags", type: .list(.scalar(String.self))), + ] + + public private(set) var resultMap: ResultMap + + public init(unsafeResultMap: ResultMap) { + self.resultMap = unsafeResultMap + } + + public init(tags: [String?]? = nil) { + self.init(unsafeResultMap: ["__typename": "ClassDetailType", "tags": tags]) + } + + public var __typename: String { + get { + return resultMap["__typename"]! as! String + } + set { + resultMap.updateValue(newValue, forKey: "__typename") + } + } + + public var tags: [String?]? { + get { + return resultMap["tags"] as? [String?] + } + set { + resultMap.updateValue(newValue, forKey: "tags") + } + } + } + } + } +} + public final class AllGymsQuery: GraphQLQuery { public let operationDefinition = "query AllGyms {\n gyms {\n __typename\n name\n id\n description\n popular\n times {\n __typename\n day\n startTime\n endTime\n }\n }\n}" diff --git a/Fitness/AppDelegate.swift b/Fitness/AppDelegate.swift index d899e8e4..90de8df6 100644 --- a/Fitness/AppDelegate.swift +++ b/Fitness/AppDelegate.swift @@ -16,8 +16,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? static let networkManager = NetworkManager() + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) window?.makeKeyAndVisible() window?.rootViewController = TabBarController() diff --git a/Fitness/Controllers/ClassDetailViewController.swift b/Fitness/Controllers/ClassDetailViewController.swift index 1dc54af2..766c1b32 100644 --- a/Fitness/Controllers/ClassDetailViewController.swift +++ b/Fitness/Controllers/ClassDetailViewController.swift @@ -89,7 +89,7 @@ class ClassDetailViewController: UIViewController { make.top.equalToSuperview() make.bottom.equalTo(view.snp.bottom) } - + // HEADER setupHeader() @@ -191,21 +191,21 @@ class ClassDetailViewController: UIViewController { } } } - + func setupHeader() { classImageView.contentMode = UIViewContentMode.scaleAspectFill classImageView.translatesAutoresizingMaskIntoConstraints = false contentView.addSubview(classImageView) - + imageFilterView = UIView() imageFilterView.backgroundColor = UIColor(displayP3Red: 0, green: 0, blue: 0, alpha: 0.6) contentView.addSubview(imageFilterView) - + semicircleView = UIImageView(image: #imageLiteral(resourceName: "semicircle")) semicircleView.contentMode = UIViewContentMode.scaleAspectFit semicircleView.translatesAutoresizingMaskIntoConstraints = false contentView.addSubview(semicircleView) - + titleLabel = UILabel() titleLabel.text = gymClassInstance.classDescription.name titleLabel.font = ._48Bebas @@ -213,13 +213,13 @@ class ClassDetailViewController: UIViewController { titleLabel.textColor = .white titleLabel.sizeToFit() contentView.addSubview(titleLabel) - + locationLabel.font = ._14MontserratLight locationLabel.textAlignment = .center locationLabel.textColor = .white locationLabel.sizeToFit() contentView.addSubview(locationLabel) - + instructorLabel = UILabel() instructorLabel.text = gymClassInstance.instructor.name instructorLabel.font = ._18Bebas @@ -227,19 +227,19 @@ class ClassDetailViewController: UIViewController { instructorLabel.textColor = .white instructorLabel.sizeToFit() contentView.addSubview(instructorLabel) - + durationLabel.font = ._18Bebas durationLabel.textAlignment = .center durationLabel.textColor = .fitnessBlack durationLabel.sizeToFit() contentView.addSubview(durationLabel) - + backButton = UIButton() backButton.setImage(#imageLiteral(resourceName: "back-arrow"), for: .normal) backButton.sizeToFit() backButton.addTarget(self, action: #selector(self.back), for: .touchUpInside) contentView.addSubview(backButton) - + starButton = UIButton() starButton.setImage(#imageLiteral(resourceName: "white-star"), for: .normal) starButton.sizeToFit() @@ -403,23 +403,23 @@ class ClassDetailViewController: UIViewController { // TODO: Replace with favorite functionality print("favorite") } - - @objc func addToCalendar(){ + + @objc func addToCalendar() { let store = EKEventStore() store.requestAccess(to: .event) {(granted, error) in if !granted { return } - + let event = EKEvent(eventStore: store) event.title = self.gymClassInstance.classDescription.name event.startDate = Date.getDateFromTime(time: self.gymClassInstance.startTime) event.endDate = event.startDate.addingTimeInterval(TimeInterval(Date.getMinutesFromDuration(duration: self.gymClassInstance.duration)*60)) event.location = self.location event.calendar = store.defaultCalendarForNewEvents - + let alert = UIAlertController(title: "\(self.gymClassInstance.classDescription.name) added to calendar", message: "Get ready to get sweaty", preferredStyle: .alert) alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Dismiss calendar alert"), style: .default)) self.present(alert, animated: true, completion: nil) - + do { try store.save(event, span: .thisEvent, commit: true) } catch { diff --git a/Fitness/Controllers/FilterViewController.swift b/Fitness/Controllers/FilterViewController.swift index 4407ec21..3b448160 100644 --- a/Fitness/Controllers/FilterViewController.swift +++ b/Fitness/Controllers/FilterViewController.swift @@ -120,7 +120,7 @@ class FilterViewController: UIViewController { classTypeDropdownData = DropdownData(dropStatus: .up, titles: [], completed: false) AppDelegate.networkManager.getClassNames { (classNames) in - + self.classTypeDropdownData.titles.append(contentsOf: classNames) self.classTypeDropdownData.completed = true @@ -149,7 +149,7 @@ class FilterViewController: UIViewController { instructorDropdownData = DropdownData(dropStatus: .up, titles: [], completed: false) AppDelegate.networkManager.getInstructors { (instructors) in - + self.instructorDropdownData.titles.append(contentsOf: instructors) self.instructorDropdownData.completed = true @@ -171,15 +171,15 @@ class FilterViewController: UIViewController { titleView.text = "Refine Search" titleView.font = ._14LatoBlack self.navigationItem.titleView = titleView - + let doneBarButton = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(done)) doneBarButton.tintColor = .fitnessBlack self.navigationItem.rightBarButtonItem = doneBarButton - + let resetBarButton = UIBarButtonItem(title: "Reset", style: .plain, target: self, action: #selector(reset)) resetBarButton.tintColor = .fitnessBlack self.navigationItem.leftBarButtonItem = resetBarButton - + //SCROLL VIEW scrollView = UIScrollView() scrollView.showsVerticalScrollIndicator = false @@ -190,7 +190,7 @@ class FilterViewController: UIViewController { scrollView.snp.makeConstraints { (make) in make.edges.equalToSuperview() } - + contentView = UIView() scrollView.addSubview(contentView) contentView.snp.makeConstraints {make in @@ -198,40 +198,41 @@ class FilterViewController: UIViewController { make.top.equalToSuperview() make.bottom.equalTo(view.snp.bottom) } - + //COLLECTION VIEW collectionViewTitle = UILabel() collectionViewTitle.font = ._12LatoBlack collectionViewTitle.textColor = .fitnessDarkGrey collectionViewTitle.text = "FITNESS CENTER" contentView.addSubview(collectionViewTitle) - + let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal layout.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0 ) layout.minimumInteritemSpacing = 1 layout.minimumLineSpacing = 0 - + gymCollectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) gymCollectionView.allowsMultipleSelection = true gymCollectionView.backgroundColor = .fitnessLightGrey gymCollectionView.isScrollEnabled = true gymCollectionView.showsHorizontalScrollIndicator = false gymCollectionView.bounces = false - + gymCollectionView.delegate = self gymCollectionView.dataSource = self gymCollectionView.register(GymFilterCell.self, forCellWithReuseIdentifier: GymFilterCell.identifier) contentView.addSubview(gymCollectionView) - + gyms = [] - + AppDelegate.networkManager.getGymNames { (gyms) in + self.gyms = gyms self.gymCollectionView.reloadData() } } - + // MARK: - CONSTRAINTS func setupConstraints() { //COLLECTION VIEW SECTION @@ -625,7 +626,7 @@ extension FilterViewController: UITableViewDataSource { } else if tableView == classTypeDropdown { if indexPath.row < classTypeDropdownData.titles.count { cell.titleLabel.text = classTypeDropdownData.titles[indexPath.row] - + if selectedClasses.contains(classTypeDropdownData.titles[indexPath.row]) { cell.checkBoxColoring.backgroundColor = .fitnessYellow } diff --git a/Fitness/Controllers/GymDetailViewController.swift b/Fitness/Controllers/GymDetailViewController.swift index 4bdb1a63..e8f54355 100644 --- a/Fitness/Controllers/GymDetailViewController.swift +++ b/Fitness/Controllers/GymDetailViewController.swift @@ -36,7 +36,7 @@ class GymDetailViewController: UIViewController { var starButton: UIButton! var gymImageView: UIImageView! var titleLabel: UILabel! - + // Exists when gym.isOpen is false var closedLabel: UILabel? @@ -45,7 +45,7 @@ class GymDetailViewController: UIViewController { var days: [Days]! var hoursData: HoursData! var hoursPopularTimesSeparator: UIView! - + let separatorSpacing = 24 // Exist when gym.isOpen is true @@ -70,7 +70,7 @@ class GymDetailViewController: UIViewController { hoursData = HoursData(isDropped: false, data: []) facilitiesData = ["Pool", "Two-court Gymnasium", "Dance Studio", "16-lane Bowling Center"] //temp (until backend implements equiment) - + setupHeaderAndWrappingViews() setupTimes() @@ -136,7 +136,7 @@ class GymDetailViewController: UIViewController { scrollView.snp.makeConstraints { (make) in make.edges.equalToSuperview() } - + contentView = UIView() scrollView.addSubview(contentView) contentView.snp.makeConstraints { (make) in @@ -144,20 +144,20 @@ class GymDetailViewController: UIViewController { make.top.equalToSuperview() make.bottom.equalTo(view.snp.bottom) } - + //HEADER gymImageView = UIImageView() gymImageView.contentMode = UIViewContentMode.scaleAspectFill gymImageView.translatesAutoresizingMaskIntoConstraints = false gymImageView.clipsToBounds = true contentView.addSubview(gymImageView) - + Alamofire.request(gym.imageURL).responseImage { response in if let image = response.result.value { self.gymImageView.image = image } } - + if !gym.isOpen { let tempClosedLabel = UILabel() tempClosedLabel.font = ._16MontserratSemiBold @@ -166,22 +166,22 @@ class GymDetailViewController: UIViewController { tempClosedLabel.backgroundColor = .fitnessBlack tempClosedLabel.text = "CLOSED" contentView.addSubview(tempClosedLabel) - + closedLabel = tempClosedLabel } - + backButton = UIButton() backButton.setImage(#imageLiteral(resourceName: "back-arrow"), for: .normal) backButton.sizeToFit() backButton.addTarget(self, action: #selector(self.back), for: .touchUpInside) contentView.addSubview(backButton) - + starButton = UIButton() starButton.setImage(#imageLiteral(resourceName: "white-star"), for: .normal) starButton.sizeToFit() starButton.addTarget(self, action: #selector(self.favorite), for: .touchUpInside) contentView.addSubview(starButton) - + titleLabel = UILabel() titleLabel.font = ._48Bebas titleLabel.textAlignment = .center @@ -190,7 +190,7 @@ class GymDetailViewController: UIViewController { titleLabel.text = gym.name contentView.addSubview(titleLabel) } - + // MARK: - HOURS AND POPULAR TIMES func setupTimes() { //HOURS @@ -201,27 +201,27 @@ class GymDetailViewController: UIViewController { hoursTitleLabel.sizeToFit() hoursTitleLabel.text = "HOURS" contentView.addSubview(hoursTitleLabel) - + hoursTableView = UITableView(frame: .zero, style: .grouped) hoursTableView.bounces = false hoursTableView.showsVerticalScrollIndicator = false hoursTableView.separatorStyle = .none hoursTableView.backgroundColor = .white hoursTableView.isScrollEnabled = false - + hoursTableView.register(GymHoursCell.self, forCellReuseIdentifier: GymHoursCell.identifier) hoursTableView.register(GymHoursHeaderView.self, forHeaderFooterViewReuseIdentifier: GymHoursHeaderView.identifier) - + hoursTableView.delegate = self hoursTableView.dataSource = self contentView.addSubview(hoursTableView) - + hoursPopularTimesSeparator = UIView() hoursPopularTimesSeparator.backgroundColor = .fitnessLightGrey contentView.addSubview(hoursPopularTimesSeparator) - + days = [.sunday, .monday, .tuesday, .wednesday, .thursday, .friday, .saturday] - + //POPULAR TIMES if gym.isOpen { popularTimesTitleLabel = UILabel() @@ -231,20 +231,20 @@ class GymDetailViewController: UIViewController { popularTimesTitleLabel?.sizeToFit() popularTimesTitleLabel?.text = "BUSY TIMES" contentView.addSubview(popularTimesTitleLabel!) - + let data = gym.popularTimesList[Date().getIntegerDayOfWeekToday()] let todaysHours = gym.gymHoursToday - + popularTimesHistogram = Histogram(frame: CGRect(x: 0, y: 0, width: view.frame.width - 36, height: 0), data: data, todaysHours: todaysHours) contentView.addSubview(popularTimesHistogram!) - + popularTimesFacilitiesSeparator = UIView() popularTimesFacilitiesSeparator?.backgroundColor = .fitnessLightGrey contentView.addSubview(popularTimesFacilitiesSeparator!) } - + } - + // MARK: - CONSTRAINTS func setupConstraints() { //HEADER @@ -253,7 +253,7 @@ class GymDetailViewController: UIViewController { make.top.equalToSuperview().offset(-20) make.height.equalTo(360) } - + if !gym.isOpen { closedLabel?.snp.updateConstraints {make in make.left.right.equalToSuperview() @@ -326,7 +326,6 @@ class GymDetailViewController: UIViewController { make.top.equalTo(popularTimesHistogram!.snp.bottom).offset(separatorSpacing) make.height.equalTo(1) } - //FACILITIES facilitiesTitleLabel.snp.updateConstraints {make in @@ -388,7 +387,7 @@ class GymDetailViewController: UIViewController { } else { height = 427 + dropHoursHeight + 89 + facilitiesHeight + 137 + todaysClassesHeight } - + scrollView.contentSize = CGSize(width: view.frame.width, height: CGFloat(height)) } @@ -454,7 +453,7 @@ extension GymDetailViewController: UITableViewDataSource { let cell = tableView.dequeueReusableCell(withIdentifier: GymHoursCell.identifier, for: indexPath) as! GymHoursCell let date = Date() let day = (date.getIntegerDayOfWeekToday() + indexPath.row + 1) % 7 - + cell.hoursLabel.text = getStringFromDailyHours(dailyGymHours: gym.gymHoursToday) switch days[day] { diff --git a/Fitness/Controllers/HomeController.swift b/Fitness/Controllers/HomeController.swift index 64c038b3..99ab5486 100644 --- a/Fitness/Controllers/HomeController.swift +++ b/Fitness/Controllers/HomeController.swift @@ -7,56 +7,69 @@ // import UIKit import SnapKit +import Alamofire +import AlamofireImage -enum SectionType { - case allGyms - case todaysClasses - case lookingFor +enum SectionType: String { + case allGyms = "ALL GYMS" + case todaysClasses = "TODAY'S CLASSES" + case lookingFor = "I'M LOOKING FOR..." } class HomeController: UIViewController { // MARK: - INITIALIZATION - var tableView: UITableView! + var mainCollectionView: UICollectionView! + var todayClassCollectionView: UICollectionView! + var statusBarBackgroundColor: UIView! + var headerView: HomeScreenHeaderView! var sections: [SectionType] = [] var gyms: [Gym] = [] var gymClassInstances: [GymClassInstance] = [] var gymLocations: [Int: String] = [:] var tags: [Tag] = [] + var didSetupHeaderShadow = false override func viewDidLoad() { super.viewDidLoad() - tableView = UITableView(frame: .zero, style: .grouped) - tableView.bounces = false - tableView.dataSource = self - tableView.delegate = self + headerView = HomeScreenHeaderView() + headerView.setName(name: "Austin") + + view.addSubview(headerView) + headerView.snp.makeConstraints { make in + make.leading.trailing.top.equalToSuperview() + make.height.equalTo(100) + } - tableView.sectionFooterHeight = 0.0 - tableView.backgroundColor = .white - tableView.separatorStyle = .none - tableView.showsVerticalScrollIndicator = false + let flowLayout = UICollectionViewFlowLayout() + flowLayout.minimumInteritemSpacing = 6.0 + flowLayout.minimumLineSpacing = 6.0 - tableView.register(TodaysClassesCell.self, forCellReuseIdentifier: TodaysClassesCell.identifier) - tableView.register(AllGymsCell.self, forCellReuseIdentifier: AllGymsCell.identifier) - tableView.register(LookingForCell.self, forCellReuseIdentifier: LookingForCell.identifier) + mainCollectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) + mainCollectionView.dataSource = self + mainCollectionView.delegate = self + mainCollectionView.backgroundColor = .white + mainCollectionView.showsVerticalScrollIndicator = false - tableView.register(HomeScreenHeaderView.self, forHeaderFooterViewReuseIdentifier: HomeScreenHeaderView.identifier) - tableView.register(HomeSectionHeaderView.self, forHeaderFooterViewReuseIdentifier: HomeSectionHeaderView.identifier) + mainCollectionView.register(HomeSectionHeaderView.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: HomeSectionHeaderView.identifier) + mainCollectionView.register(GymsCell.self, forCellWithReuseIdentifier: GymsCell.identifier) + mainCollectionView.register(TodaysClassesCell.self, forCellWithReuseIdentifier: TodaysClassesCell.identifier) + mainCollectionView.register(LookingForCell.self, forCellWithReuseIdentifier: LookingForCell.identifier) sections.insert(.allGyms, at: 0) sections.insert(.todaysClasses, at: 1) sections.insert(.lookingFor, at: 2) - view.addSubview(tableView) + view.addSubview(mainCollectionView) - tableView.snp.updateConstraints {make in - make.top.equalToSuperview() + mainCollectionView.snp.makeConstraints {make in + make.top.equalTo(headerView.snp.bottom) make.centerX.equalToSuperview() make.width.equalToSuperview() - make.bottom.equalToSuperview().offset(-49) + make.bottom.equalToSuperview() } statusBarBackgroundColor = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 21)) @@ -64,9 +77,9 @@ class HomeController: UIViewController { view.addSubview(statusBarBackgroundColor) // GET GYMS - AppDelegate.networkManager.getGyms { (gyms) in - self.gyms = gyms - self.tableView.reloadData() + NetworkManager.shared.getGyms { (gyms) in + self.gyms = gyms.sorted { $0.isOpen && !$1.isOpen } + self.mainCollectionView.reloadSections(IndexSet(integer: 0)) } // GET TODAY'S CLASSES @@ -77,98 +90,172 @@ class HomeController: UIViewController { for gymClassInstance in gymClassInstances { AppDelegate.networkManager.getGym(gymId: gymClassInstance.gymId, completion: { (gym) in self.gymLocations[gymClassInstance.gymId] = gym.name - self.tableView.reloadData() + self.mainCollectionView.reloadSections(IndexSet(integer: 1)) }) } } } // GET TAGS - AppDelegate.networkManager.getTags { (tags) in + NetworkManager.shared.getTags { tags in self.tags = tags - self.tableView.reloadData() + self.mainCollectionView.reloadSections(IndexSet(integer: 2)) } } - + // MARK: - ViewDidLoad override func viewDidAppear(_ animated: Bool) { - let allGymsCell = tableView.cellForRow(at: IndexPath(row: 0, section: sections.index(of: .allGyms)!) ) as! AllGymsCell - allGymsCell.gyms = {allGymsCell.gyms}() - - let todaysClassesCell = tableView.cellForRow(at: IndexPath(row: 0, section: sections.index(of: .todaysClasses)!) ) as! TodaysClassesCell - todaysClassesCell.gymClassInstances = {todaysClassesCell.gymClassInstances}() +// +// let allGymsCell = tableView.cellForRow(at: IndexPath(row: 0, section: sections.index(of: .allGyms)!) ) as! AllGymsCell +// allGymsCell.gyms = {allGymsCell.gyms}() +// +// let todaysClassesCell = tableView.cellForRow(at: IndexPath(row: 0, section: sections.index(of: .todaysClasses)!) ) as! TodaysClassesCell +// todaysClassesCell.gymClassInstances = {todaysClassesCell.gymClassInstances}() } } -// MARK: TableViewDataSource -extension HomeController: UITableViewDataSource { - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { +// MARK: CollectionViewDataSource +extension HomeController: UICollectionViewDataSource { - switch sections[indexPath.section] { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if collectionView != mainCollectionView { + return gymClassInstances.count + } + + switch sections[section] { case .allGyms: - let cell = tableView.dequeueReusableCell(withIdentifier: AllGymsCell.identifier, for: indexPath) as! AllGymsCell - cell.gyms = gyms - cell.navigationController = navigationController - return cell + return gyms.count case .todaysClasses: - let cell = tableView.dequeueReusableCell(withIdentifier: TodaysClassesCell.identifier, for: indexPath) as! TodaysClassesCell - cell.gymClassInstances = gymClassInstances - cell.gymLocations = gymLocations - cell.navigationController = navigationController - return cell + return 1 case .lookingFor: - let cell = tableView.dequeueReusableCell(withIdentifier: LookingForCell.identifier, for: indexPath) as! LookingForCell - cell.tags = tags + return tags.count + } + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + + if collectionView != mainCollectionView { + //set up today class cells + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CategoryCell.identifier, for: indexPath) as! CategoryCell + + Alamofire.request(tags[indexPath.row].imageURL).responseImage { response in + if let image = response.result.value { + cell.image.image = image + } + } + + cell.title.text = tags[indexPath.row].name.capitalized return cell } + + switch sections[indexPath.section] { + case .allGyms: + let gym = gyms[indexPath.row] + // swiftlint:disable:next force_cast + let gymCell = collectionView.dequeueReusableCell(withReuseIdentifier: GymsCell.identifier, for: indexPath) as! GymsCell + gymCell.setGymName(name: gym.name) + gymCell.setGymStatus(isOpen: gym.isOpen) + gymCell.setGymHours(hours: getHourString(gym: gym)) + return gymCell + case .todaysClasses: + let todayClassesCell = collectionView.dequeueReusableCell(withReuseIdentifier: TodaysClassesCell.identifier, for: indexPath) as! TodaysClassesCell + todayClassesCell.collectionView.dataSource = self + todayClassesCell.collectionView.delegate = self + return todayClassesCell + case .lookingFor: + let lookingForCell = collectionView.dequeueReusableCell(withReuseIdentifier: LookingForCell.identifier, for: indexPath) as! LookingForCell + return lookingForCell + } } - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 1 + func numberOfSections(in collectionView: UICollectionView) -> Int { + return 3 } - func numberOfSections(in tableView: UITableView) -> Int { - return sections.count + func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { + + if collectionView != mainCollectionView { return UICollectionReusableView() } + + switch kind { + case UICollectionElementKindSectionHeader: + // swiftlint:disable:next force_cast + let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionElementKindSectionHeader, withReuseIdentifier: HomeSectionHeaderView.identifier, for: indexPath) as! HomeSectionHeaderView + headerView.setTitle(title: sections[indexPath.section].rawValue) + return headerView + default: + fatalError("Unexpected element kind") + } } } -// MARK: TableViewDelegate -extension HomeController: UITableViewDelegate { - func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { - switch sections[section] { +// MARK: UICollectionViewDelegate +extension HomeController: UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { + if collectionView != mainCollectionView { return .zero } + return CGSize(width: collectionView.bounds.width, height: 32.0) + } + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + if collectionView != mainCollectionView { return CGSize(width: 228.0, height: 195.0)} + + switch sections[indexPath.section] { case .allGyms: - let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: HomeScreenHeaderView.identifier) as! HomeScreenHeaderView - header.subHeader.titleLabel.text = "ALL GYMS" - header.setName(name: "Joe") - return header + let spacingInsets: CGFloat = 32.0 + //12.0 is the spacing between each cell + let totalWidth = collectionView.bounds.width - spacingInsets - 12.0 + return CGSize(width: totalWidth/2.0, height: 60.0) case .todaysClasses: - let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: HomeSectionHeaderView.identifier) as! HomeSectionHeaderView - header.titleLabel.text = "TODAY'S CLASSES" - return header + return CGSize(width: collectionView.bounds.width, height: 195.0) case .lookingFor: - let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: HomeSectionHeaderView.identifier) as! HomeSectionHeaderView - header.titleLabel.text = "I'M LOOKING FOR..." - return header + return CGSize(width: 164.0, height: 128.0) } } - func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + switch sections[section] { + case .allGyms, .lookingFor: + return UIEdgeInsets(top: 0.0, left: 16.0, bottom: 32.0, right: 16.0) + case .todaysClasses: + return UIEdgeInsets(top: 0.0, left: 0.0, bottom: 32.0, right: 0.0) + } + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + if collectionView != mainCollectionView { + return + } + switch sections[indexPath.section] { case .allGyms: - return 180 + let gymDetailViewController = GymDetailViewController() + gymDetailViewController.gym = gyms[indexPath.row] + navigationController?.pushViewController(gymDetailViewController, animated: true) case .todaysClasses: - return 207 + print("SELECTED TODAY CLASSES") case .lookingFor: - return CGFloat(143 * (tags.count / 2)) + print("SELECTED LOOKING FOR") } } +} - func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { - switch sections[section] { - case .allGyms: - return 155 - case .todaysClasses, .lookingFor: - return 51 +extension HomeController { + + func getHourString(gym: Gym) -> String { + let now = Date() + let isOpen = gym.isOpen + + let gymHoursToday = gym.gymHoursToday + let gymHoursTomorrow = gym.gymHours[now.getIntegerDayOfWeekTomorrow()] + + if gym.name == "Bartels" { + return "Always open" + } else if now > gymHoursToday.closeTime { + return "Opens at \(gymHoursTomorrow.openTime.getStringOfDatetime(format: "h a")), tomorrow" + } else if !isOpen { + return "Opens at \(gymHoursToday.openTime.getStringOfDatetime(format: "h a"))" + } else { + return "Closes at \(gymHoursToday.closeTime.getStringOfDatetime(format: "h a"))" } } } diff --git a/Fitness/Extensions/Date+Shared.swift b/Fitness/Extensions/Date+Shared.swift index 33d3ad8c..a1654f87 100644 --- a/Fitness/Extensions/Date+Shared.swift +++ b/Fitness/Extensions/Date+Shared.swift @@ -34,17 +34,17 @@ extension Date { return calendar.date(from: dateComponents)! } - + static public func getDatetimeFromString(datetime: String?) -> Date { guard let datetime = datetime else { return Date() } let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS" - + return dateFormatter.date(from: datetime) ?? Date() } - + static public func getTimeFromString(datetime: String?) -> Date { guard let datetime = datetime else { return Date() @@ -52,18 +52,18 @@ extension Date { let today = Date() let dateFormatter = DateFormatter() dateFormatter.dateFormat = "HH:mm:ss" - + let date = dateFormatter.date(from: datetime) ?? today let calendar = Calendar.current var dateComponents = DateComponents() - + dateComponents.year = calendar.component(.year, from: today) dateComponents.month = calendar.component(.month, from: today) dateComponents.day = calendar.component(.day, from: today) dateComponents.timeZone = TimeZone.current dateComponents.hour = calendar.component(.hour, from: date) dateComponents.minute = calendar.component(.minute, from: date) - + return calendar.date(from: dateComponents)! } @@ -98,7 +98,7 @@ extension Date { func getIntegerDayOfWeekTomorrow() -> Int { return Calendar.current.component(.weekday, from: self) % 7 } - + // MARK: - String func getStringOfDatetime(format: String) -> String { let dateFormatter = DateFormatter() diff --git a/Fitness/Extensions/UIFont+Shared.swift b/Fitness/Extensions/UIFont+Shared.swift index 815d743b..31e1d7fc 100644 --- a/Fitness/Extensions/UIFont+Shared.swift +++ b/Fitness/Extensions/UIFont+Shared.swift @@ -39,7 +39,7 @@ extension UIFont { static let _14MontserratBold = UIFont(name: "Montserrat-Bold", size: 14) static let _24MontserratBold = UIFont(name: "Montserrat-Bold", size: 24) - + static let _16MontserratSemiBold = UIFont(name: "Montserrat-SemiBold", size: 16) //LATO diff --git a/Fitness/Models/Gym.swift b/Fitness/Models/Gym.swift index 07d62ef6..d1a29121 100644 --- a/Fitness/Models/Gym.swift +++ b/Fitness/Models/Gym.swift @@ -13,27 +13,27 @@ struct Gym { let name: String let equipment: String let gymHours: [DailyGymHours] - + /// Array of 7 arrays of count 24, representing the busyness in each hour, Sun..Sat let popularTimesList: [[Int]] let imageURL: String var isOpen: Bool { return Date() > gymHoursToday.openTime ? Date() < gymHoursToday.closeTime : false } - + var gymHoursToday: DailyGymHours { return gymHours[Date().getIntegerDayOfWeekToday()] } - + init(gymData: AllGymsQuery.Data.Gym ) { id = gymData.id ?? "" name = gymData.name ?? "" equipment = "" // TODO : fetch equipment once it's availble from backend imageURL = "https://raw.githubusercontent.com/cuappdev/assets/master/uplift/gyms/\(name.replacingOccurrences(of: " ", with: "_")).jpg" - + var popularTimes = Array.init(repeating: Array.init(repeating: 0, count: 24), count: 7) - + if let popular = gymData.popular { for i in 0.. Void) { - apollo.fetch(query: AllGymsQuery()){ (result, error) in + apollo.fetch(query: AllGymsQuery()) { (result, error) in var gyms: [Gym] = [] - + for gymData in result?.data?.gyms ?? [] { if let gymData = gymData { gyms.append(Gym(gymData: gymData)) @@ -31,20 +32,20 @@ struct NetworkManager { completion(gyms) } } - + func getGymNames(completion: @escaping ([GymNameId]) -> Void) { - apollo.fetch(query: AllGymsQuery()){ (result, error) in + apollo.fetch(query: AllGymsQuery()) { (result, error) in // implement var gyms: [GymNameId] = [] - + for gym in result?.data?.gyms ?? [] { guard let gym = gym else { continue } - + gyms.append(GymNameId(name: gym.name ?? "", id: gym.id ?? "") ) } - + completion(gyms) } } @@ -66,7 +67,6 @@ struct NetworkManager { // } } - // MARK: - GYM CLASS INSTANCES func getGymClassInstances(completion: @escaping ([GymClassInstance]) -> Void) { // provider.request(.gymClassInstances) { result in @@ -139,7 +139,7 @@ struct NetworkManager { } // MARK: - GYM CLASS DESCRIPTIONS - func getGymClassDescriptions(completion: @escaping ([GymClassDescription])->Void) { + func getGymClassDescriptions(completion: @escaping ([GymClassDescription]) -> Void) { // provider.request(.gymClassDescriptions) { result in // switch result { // case let .success(response): @@ -192,20 +192,16 @@ struct NetworkManager { // MARK: - TAGS func getTags(completion: @escaping ([Tag]) -> Void) { -// provider.request(.tags) { result in -// switch result { -// case let .success(response): -// do { -// let tagsData = try JSONDecoder().decode(TagsRootData.self, from: response.data) -// let tags = tagsData.data -// completion(tags) -// } catch let err { -// print(err) -// } -// case let .failure(error): -// print(error) -// } -// } + apollo.fetch(query: GetTagsQuery()) { (results, error) in + guard let data = results?.data, let classes = data.classes else { return } + let allClasses = classes.compactMap { $0 } + + let tags = allClasses.map { gymClass in + let details = gymClass.details + + } + } + } // MARK: - GYM CLASSES @@ -225,15 +221,15 @@ struct NetworkManager { // } // } } - + func getClassNames(completion: @escaping (Set) -> Void) { apollo.fetch(query: AllClassNamesQuery()) { (result, error) in var classNames: Set = [] - + for gymClass in result?.data?.classes ?? [] { classNames.insert(gymClass?.details?.name ?? "") } - + completion(classNames) } } @@ -259,11 +255,11 @@ struct NetworkManager { func getInstructors(completion: @escaping (Set) -> Void) { apollo.fetch(query: AllIntructorsQuery()) { (result, error) in var instructors: Set = [] - + for gymClass in result?.data?.classes ?? [] { instructors.insert(gymClass?.instructor ?? "") } - + completion(instructors) } } diff --git a/Fitness/Views/Cells/AllGymsCell.swift b/Fitness/Views/Cells/AllGymsCell.swift index cabd4c09..db7fa0cc 100644 --- a/Fitness/Views/Cells/AllGymsCell.swift +++ b/Fitness/Views/Cells/AllGymsCell.swift @@ -60,13 +60,13 @@ class AllGymsCell: UITableViewCell, UICollectionViewDelegateFlowLayout, UICollec func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: GymsCell.identifier, for: indexPath) as! GymsCell let gym = gyms[indexPath.row] - + let now = Date() let isOpen = gym.isOpen let gymHoursToday = gym.gymHoursToday let gymHoursTomorrow = gym.gymHours[now.getIntegerDayOfWeekTomorrow()] - + if gyms[indexPath.row].name == "Bartels" { cell.hours.text = "Always open" } else if now > gymHoursToday.closeTime { diff --git a/Fitness/Views/Cells/GymsCell.swift b/Fitness/Views/Cells/GymsCell.swift index b6ed6df9..7d7a3c08 100644 --- a/Fitness/Views/Cells/GymsCell.swift +++ b/Fitness/Views/Cells/GymsCell.swift @@ -46,18 +46,18 @@ class GymsCell: UICollectionViewCell { //LOCATION NAME locationName = UILabel() - locationName.font = ._12MontserratMedium - locationName.sizeToFit() + locationName.font = ._16MontserratMedium + locationName.textAlignment = .left contentView.addSubview(locationName) //STATUS status = UILabel() - status.font = ._8MontserratMedium + status.font = ._12MontserratMedium contentView.addSubview(status) //HOURS hours = UILabel() - hours.font = ._8MontserratMedium + hours.font = ._12MontserratMedium hours.textColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.35) contentView.addSubview(hours) @@ -79,12 +79,12 @@ class GymsCell: UICollectionViewCell { locationName.snp.updateConstraints {make in make.top.equalToSuperview().offset(10) make.bottom.equalToSuperview().offset(-23) - make.left.equalToSuperview().offset(17) - make.right.equalToSuperview().offset(-26) + make.leading.equalToSuperview().offset(10) + make.trailing.lessThanOrEqualToSuperview() } status.snp.updateConstraints {make in - make.left.equalToSuperview().offset(17) + make.leading.equalTo(locationName) make.bottom.equalToSuperview().offset(-10) make.top.equalToSuperview().offset(28) } @@ -96,4 +96,18 @@ class GymsCell: UICollectionViewCell { make.top.equalToSuperview().offset(28) } } + + func setGymName(name: String) { + locationName.text = name + } + + func setGymStatus(isOpen: Bool) { + let color: UIColor = isOpen ? .fitnessGreen : .fitnessRed + self.status.text = isOpen ? "Open" : "Closed" + self.status.textColor = color + } + + func setGymHours(hours: String) { + self.hours.text = hours + } } diff --git a/Fitness/Views/Cells/LookingForCell.swift b/Fitness/Views/Cells/LookingForCell.swift index 8944224e..65d22b3d 100644 --- a/Fitness/Views/Cells/LookingForCell.swift +++ b/Fitness/Views/Cells/LookingForCell.swift @@ -9,65 +9,35 @@ import UIKit import Alamofire import AlamofireImage -class LookingForCell: UITableViewCell, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { +class LookingForCell: UICollectionViewCell { // MARK: - INITIALIZATION static let identifier = Identifiers.lookingForCell var collectionView: UICollectionView! - var tags: [Tag] = [] { - didSet { - collectionView.reloadData() - } - } - override init(style: UITableViewCellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) + override init(frame: CGRect) { + super.init(frame: frame) //COLLECTION VIEW LAYOUT let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical layout.sectionInset = UIEdgeInsets(top: 0, left: 16, bottom: 15, right: 16 ) - layout.minimumInteritemSpacing = 15 - layout.minimumLineSpacing = 15 + layout.itemSize = CGSize(width: 228.0, height: 100.0) + layout.minimumInteritemSpacing = 16 collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) - collectionView.delegate = self - collectionView.dataSource = self collectionView.backgroundColor = .white collectionView.register(CategoryCell.self, forCellWithReuseIdentifier: CategoryCell.identifier) contentView.addSubview(collectionView) - collectionView.snp.updateConstraints {make in - make.center.equalToSuperview() - make.size.equalToSuperview() + collectionView.snp.makeConstraints { make in + make.edges.equalToSuperview() } } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } - - // MARK: - COLLECTION VIEW - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CategoryCell.identifier, for: indexPath) as! CategoryCell - - Alamofire.request(tags[indexPath.row].imageURL).responseImage { response in - if let image = response.result.value { - cell.image.image = image - } - } - - cell.title.text = tags[indexPath.row].name.capitalized - return cell - } - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return tags.count - } - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: (frame.width - 47)/2, height: 128) - } } diff --git a/Fitness/Views/Cells/TodaysClassesCell.swift b/Fitness/Views/Cells/TodaysClassesCell.swift index 69dd84bc..cbca688e 100644 --- a/Fitness/Views/Cells/TodaysClassesCell.swift +++ b/Fitness/Views/Cells/TodaysClassesCell.swift @@ -10,7 +10,7 @@ import SnapKit import Alamofire import AlamofireImage -class TodaysClassesCell: UITableViewCell, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { +class TodaysClassesCell: UICollectionViewCell, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource { // MARK: - INITIALIZATION static let identifier = Identifiers.todaysClassesCell @@ -23,7 +23,7 @@ class TodaysClassesCell: UITableViewCell, UICollectionViewDelegateFlowLayout, UI gymClassInstances.sort { Date.getDateFromTime(time: $0.startTime) < Date.getDateFromTime(time: $1.startTime) } - + collectionView.reloadData() } } @@ -36,15 +36,15 @@ class TodaysClassesCell: UITableViewCell, UICollectionViewDelegateFlowLayout, UI var navigationController: UINavigationController? - override init(style: UITableViewCellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) + override init(frame: CGRect) { + super.init(frame: frame) //COLLECTION VIEW LAYOUT let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal - layout.sectionInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16 ) + //layout.sectionInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16 ) layout.minimumInteritemSpacing = 16 - layout.minimumLineSpacing = 12 + layout.itemSize = CGSize(width: 228.0, height: 195.0) collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) collectionView.delegate = self @@ -57,9 +57,8 @@ class TodaysClassesCell: UITableViewCell, UICollectionViewDelegateFlowLayout, UI contentView.addSubview(collectionView) - collectionView.snp.updateConstraints {make in - make.center.equalToSuperview() - make.size.equalToSuperview() + collectionView.snp.makeConstraints {make in + make.edges.equalToSuperview() } } diff --git a/Fitness/Views/Headers/HomeScreenHeaderView.swift b/Fitness/Views/Headers/HomeScreenHeaderView.swift index a51f301f..02deabc5 100644 --- a/Fitness/Views/Headers/HomeScreenHeaderView.swift +++ b/Fitness/Views/Headers/HomeScreenHeaderView.swift @@ -8,28 +8,17 @@ import UIKit import SnapKit -class HomeScreenHeaderView: UITableViewHeaderFooterView { +class HomeScreenHeaderView: UIView { - // MARK: - INITIALIZATION - static let identifier = Identifiers.homeScreenHeaderView var welcomeMessage: UILabel! - var subHeader: HomeSectionHeaderView! - override init(reuseIdentifier: String?) { - super.init(reuseIdentifier: reuseIdentifier) + var didSetupShadow = false - //BACKGROUND COLOR - backgroundView = UIView(frame: frame) - backgroundView?.backgroundColor = .white + override init(frame: CGRect) { + super.init(frame: frame) - //SHADOWING - contentView.layer.shadowColor = UIColor.black.cgColor - contentView.layer.shadowOpacity = 0.3 - contentView.layer.shadowRadius = 5.0 - contentView.layer.masksToBounds = false - contentView.layer.shadowOffset = CGSize(width: 0.0, height: 15.0) - let shadowFrame = UIEdgeInsetsInsetRect(contentView.frame, UIEdgeInsets(top: 0, left: 0, bottom: -100, right: 0)) - contentView.layer.shadowPath = UIBezierPath(rect: shadowFrame).cgPath + //BACKGROUND COLOR + backgroundColor = .white //WELCOME MESSAGE welcomeMessage = UILabel() @@ -39,10 +28,6 @@ class HomeScreenHeaderView: UITableViewHeaderFooterView { welcomeMessage.numberOfLines = 0 addSubview(welcomeMessage) - //FIRST SECTION'S HEADER - subHeader = HomeSectionHeaderView(frame: CGRect()) - addSubview(subHeader) - setupLayout() } @@ -51,23 +36,25 @@ class HomeScreenHeaderView: UITableViewHeaderFooterView { } func setName(name: String) { - welcomeMessage.text = "Good Afternoon, " + name + "!" + welcomeMessage.text = getGreeting() + name + "!" + } + + private func getGreeting() -> String { + let currDate = Date() + let hour = Calendar.current.component(.hour, from: currDate) + + if hour < 12 { return " Good Morning, " } + if hour < 17 { return "Good Afternoon, "} + return "Good Evening, " } // MARK: - LAYOUT func setupLayout() { - welcomeMessage.snp.updateConstraints { make in - make.height.equalTo(26) - make.left.equalToSuperview().offset(24) - make.bottom.equalToSuperview().offset(-75) - } - - subHeader.snp.updateConstraints {make in - make.width.equalToSuperview() - make.centerX.equalToSuperview() - make.bottom.equalToSuperview() - make.top.equalToSuperview().offset(100) + welcomeMessage.snp.makeConstraints { make in + make.bottom.equalToSuperview().inset(20) + make.leading.equalTo(24) + make.trailing.lessThanOrEqualToSuperview().inset(24) } } } diff --git a/Fitness/Views/Headers/HomeSectionHeaderView.swift b/Fitness/Views/Headers/HomeSectionHeaderView.swift index ffc37e9c..65fe231e 100644 --- a/Fitness/Views/Headers/HomeSectionHeaderView.swift +++ b/Fitness/Views/Headers/HomeSectionHeaderView.swift @@ -7,27 +7,35 @@ // import UIKit -class HomeSectionHeaderView: UITableViewHeaderFooterView { +class HomeSectionHeaderView: UICollectionReusableView { // MARK: - INITIALIZATION static let identifier = Identifiers.homeSectionHeaderView var titleLabel: UILabel! - override init(reuseIdentifier: String?) { - super.init(reuseIdentifier: reuseIdentifier) + override init(frame: CGRect) { + super.init(frame: frame) backgroundColor = UIColor.clear titleLabel = UILabel() - titleLabel.font = ._12LatoBlack + titleLabel.font = ._14MontserratBold titleLabel.textColor = .fitnessDarkGrey addSubview(titleLabel) // MARK: - CONSTRAINTS titleLabel.snp.updateConstraints {make in - make.left.equalToSuperview().offset(19) - make.top.equalToSuperview().offset(20) - make.bottom.equalToSuperview().offset(-20) + make.leading.equalTo(16) + make.top.equalToSuperview() + make.height.equalTo(titleLabel.intrinsicContentSize.height) + } + } + + func setTitle(title: String) { + titleLabel.text = title + + titleLabel.snp.updateConstraints { make in + make.height.equalTo(titleLabel.intrinsicContentSize.height) } } diff --git a/Fitness/Views/Histogram.swift b/Fitness/Views/Histogram.swift index 68a65214..b3ce3ac0 100644 --- a/Fitness/Views/Histogram.swift +++ b/Fitness/Views/Histogram.swift @@ -13,7 +13,6 @@ import UIKit import SnapKit - class Histogram: UIView { // MARK: - INITIALIZATION @@ -24,7 +23,7 @@ class Histogram: UIView { var selectedIndex: Int! var selectedLine: UIView! var selectedTime: UILabel! - + var selectedTimeDescriptor: UILabel! let timeDescriptors = ["Usually not too busy", "Usually a little busy", "Usually as busy as it gets"] let mediumThreshold = 43 @@ -47,7 +46,7 @@ class Histogram: UIView { bottomAxisTicks = [] openHour = Calendar.current.component(.hour, from: todaysHours.openTime) let closeHour = Calendar.current.component(.hour, from: todaysHours.closeTime) - + for _ in openHour..<(closeHour - 1) { let tick = UIView() tick.backgroundColor = .fitnessLightGrey @@ -66,7 +65,7 @@ class Histogram: UIView { let gesture = UITapGestureRecognizer(target: self, action: #selector(self.selectBar(sender:))) bar.addGestureRecognizer(gesture) } - + //TIME let currentHour = Calendar.current.component(.hour, from: Date()) selectedIndex = currentHour - openHour @@ -202,7 +201,7 @@ class Histogram: UIView { break } } - + //update selectedTime and the descriptor if data[selectedIndex + openHour - 1] < mediumThreshold { selectedTimeDescriptor.text = timeDescriptors[0] diff --git a/Fitness/graphql/tagQueries.graphql b/Fitness/graphql/tagQueries.graphql new file mode 100644 index 00000000..6f3cfe8d --- /dev/null +++ b/Fitness/graphql/tagQueries.graphql @@ -0,0 +1,16 @@ +query GetTags { + classes { + details { + tags { + label + url + color { + red + blue + green + alpha + } + } + } + } +} diff --git a/schema.json b/schema.json index a3054600..cb0c6940 100644 --- a/schema.json +++ b/schema.json @@ -1 +1 @@ -{"__schema": {"queryType": {"name": "Query"}, "mutationType": null, "subscriptionType": null, "types": [{"kind": "OBJECT", "name": "Query", "description": null, "fields": [{"name": "gyms", "description": null, "args": [{"name": "now", "description": null, "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "defaultValue": null}, {"name": "id", "description": null, "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "defaultValue": null}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "GymType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "classes", "description": null, "args": [{"name": "now", "description": null, "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "defaultValue": null}, {"name": "tags", "description": null, "type": {"kind": "LIST", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "defaultValue": null}, {"name": "gymId", "description": null, "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "defaultValue": null}, {"name": "instructor", "description": null, "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "defaultValue": null}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "ClassType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "GymType", "description": null, "fields": [{"name": "id", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "ID", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "name", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "popular", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "SCALAR", "name": "Int", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "times", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "DayTimeRangeType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "ID", "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "String", "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Int", "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31 - 1) and 2^31 - 1 since represented in JSON as double-precision floating point numbers specifiedby [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "DayTimeRangeType", "description": null, "fields": [{"name": "day", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "startTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Time", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "endTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Time", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Time", "description": "The `Time` scalar type represents a Time value as\nspecified by\n[iso8601](https://en.wikipedia.org/wiki/ISO_8601).", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "DateTime", "description": "The `DateTime` scalar type represents a DateTime\nvalue as specified by\n[iso8601](https://en.wikipedia.org/wiki/ISO_8601).", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "ClassType", "description": null, "fields": [{"name": "id", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "ID", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "gymId", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "ID", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "gym", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "GymType", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "detailsId", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "ID", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "details", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "ClassDetailType", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "startTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "endTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "instructor", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "isCancelled", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Boolean", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "ClassDetailType", "description": null, "fields": [{"name": "id", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "ID", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "name", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "tags", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Boolean", "description": "The `Boolean` scalar type represents `true` or `false`.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__Schema", "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation and subscription operations.", "fields": [{"name": "types", "description": "A list of all types supported by this server.", "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "queryType", "description": "The type that query operations will be rooted at.", "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "mutationType", "description": "If this server supports mutation, the type that mutation operations will be rooted at.", "args": [], "type": {"kind": "OBJECT", "name": "__Type", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "subscriptionType", "description": "If this server support subscription, the type that subscription operations will be rooted at.", "args": [], "type": {"kind": "OBJECT", "name": "__Type", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "directives", "description": "A list of all directives supported by this server.", "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Directive", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__Type", "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", "fields": [{"name": "kind", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "ENUM", "name": "__TypeKind", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "name", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "fields", "description": null, "args": [{"name": "includeDeprecated", "description": null, "type": {"kind": "SCALAR", "name": "Boolean", "ofType": null}, "defaultValue": "false"}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Field", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "interfaces", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "possibleTypes", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "enumValues", "description": null, "args": [{"name": "includeDeprecated", "description": null, "type": {"kind": "SCALAR", "name": "Boolean", "ofType": null}, "defaultValue": "false"}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__EnumValue", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "inputFields", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__InputValue", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "ofType", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "__Type", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "ENUM", "name": "__TypeKind", "description": "An enum describing what kind of type a given `__Type` is", "fields": null, "inputFields": null, "interfaces": null, "enumValues": [{"name": "SCALAR", "description": "Indicates this type is a scalar.", "isDeprecated": false, "deprecationReason": null}, {"name": "OBJECT", "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", "isDeprecated": false, "deprecationReason": null}, {"name": "INTERFACE", "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", "isDeprecated": false, "deprecationReason": null}, {"name": "UNION", "description": "Indicates this type is a union. `possibleTypes` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "ENUM", "description": "Indicates this type is an enum. `enumValues` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "INPUT_OBJECT", "description": "Indicates this type is an input object. `inputFields` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "LIST", "description": "Indicates this type is a list. `ofType` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "NON_NULL", "description": "Indicates this type is a non-null. `ofType` is a valid field.", "isDeprecated": false, "deprecationReason": null}], "possibleTypes": null}, {"kind": "OBJECT", "name": "__Field", "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "args", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__InputValue", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "type", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "isDeprecated", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "deprecationReason", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__InputValue", "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "type", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "defaultValue", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__EnumValue", "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "isDeprecated", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "deprecationReason", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__Directive", "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "locations", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "ENUM", "name": "__DirectiveLocation", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "args", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__InputValue", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "onOperation", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": true, "deprecationReason": "Use `locations`."}, {"name": "onFragment", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": true, "deprecationReason": "Use `locations`."}, {"name": "onField", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": true, "deprecationReason": "Use `locations`."}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "ENUM", "name": "__DirectiveLocation", "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": [{"name": "QUERY", "description": "Location adjacent to a query operation.", "isDeprecated": false, "deprecationReason": null}, {"name": "MUTATION", "description": "Location adjacent to a mutation operation.", "isDeprecated": false, "deprecationReason": null}, {"name": "SUBSCRIPTION", "description": "Location adjacent to a subscription operation.", "isDeprecated": false, "deprecationReason": null}, {"name": "FIELD", "description": "Location adjacent to a field.", "isDeprecated": false, "deprecationReason": null}, {"name": "FRAGMENT_DEFINITION", "description": "Location adjacent to a fragment definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "FRAGMENT_SPREAD", "description": "Location adjacent to a fragment spread.", "isDeprecated": false, "deprecationReason": null}, {"name": "INLINE_FRAGMENT", "description": "Location adjacent to an inline fragment.", "isDeprecated": false, "deprecationReason": null}, {"name": "SCHEMA", "description": "Location adjacent to a schema definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "SCALAR", "description": "Location adjacent to a scalar definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "OBJECT", "description": "Location adjacent to an object definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "FIELD_DEFINITION", "description": "Location adjacent to a field definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "ARGUMENT_DEFINITION", "description": "Location adjacent to an argument definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "INTERFACE", "description": "Location adjacent to an interface definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "UNION", "description": "Location adjacent to a union definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "ENUM", "description": "Location adjacent to an enum definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "ENUM_VALUE", "description": "Location adjacent to an enum value definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "INPUT_OBJECT", "description": "Location adjacent to an input object definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "INPUT_FIELD_DEFINITION", "description": "Location adjacent to an input object field definition.", "isDeprecated": false, "deprecationReason": null}], "possibleTypes": null}], "directives": [{"name": "include", "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], "args": [{"name": "if", "description": "Included when true.", "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "defaultValue": null}]}, {"name": "skip", "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], "args": [{"name": "if", "description": "Skipped when true.", "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "defaultValue": null}]}]}} \ No newline at end of file +{"__schema": {"queryType": {"name": "Query"}, "mutationType": null, "subscriptionType": null, "types": [{"kind": "OBJECT", "name": "Query", "description": null, "fields": [{"name": "gyms", "description": null, "args": [{"name": "now", "description": null, "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "defaultValue": null}, {"name": "id", "description": null, "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "defaultValue": null}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "GymType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "classes", "description": null, "args": [{"name": "now", "description": null, "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "defaultValue": null}, {"name": "name", "description": null, "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "defaultValue": null}, {"name": "tags", "description": null, "type": {"kind": "LIST", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "defaultValue": null}, {"name": "gymId", "description": null, "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "defaultValue": null}, {"name": "instructor", "description": null, "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "defaultValue": null}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "ClassType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "GymType", "description": null, "fields": [{"name": "id", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "name", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "popular", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "SCALAR", "name": "Int", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "times", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "DayTimeRangeType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "String", "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Int", "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31 - 1) and 2^31 - 1 since represented in JSON as double-precision floating point numbers specifiedby [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "DayTimeRangeType", "description": null, "fields": [{"name": "day", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "startTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Time", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "endTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Time", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Time", "description": "The `Time` scalar type represents a Time value as\nspecified by\n[iso8601](https://en.wikipedia.org/wiki/ISO_8601).", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "DateTime", "description": "The `DateTime` scalar type represents a DateTime\nvalue as specified by\n[iso8601](https://en.wikipedia.org/wiki/ISO_8601).", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "ClassType", "description": null, "fields": [{"name": "id", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "gymId", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "gym", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "GymType", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "location", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "detailsId", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "details", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "ClassDetailType", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "startTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "endTime", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "DateTime", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "instructor", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "isCancelled", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Boolean", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "ClassDetailType", "description": null, "fields": [{"name": "id", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "name", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "tags", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "OBJECT", "name": "TagType", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "categories", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "TagType", "description": null, "fields": [{"name": "label", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "url", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "color", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "ColorType", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "ColorType", "description": null, "fields": [{"name": "red", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "green", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "blue", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Int", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "alpha", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "Float", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Float", "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "SCALAR", "name": "Boolean", "description": "The `Boolean` scalar type represents `true` or `false`.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__Schema", "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation and subscription operations.", "fields": [{"name": "types", "description": "A list of all types supported by this server.", "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "queryType", "description": "The type that query operations will be rooted at.", "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "mutationType", "description": "If this server supports mutation, the type that mutation operations will be rooted at.", "args": [], "type": {"kind": "OBJECT", "name": "__Type", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "subscriptionType", "description": "If this server support subscription, the type that subscription operations will be rooted at.", "args": [], "type": {"kind": "OBJECT", "name": "__Type", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "directives", "description": "A list of all directives supported by this server.", "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Directive", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__Type", "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", "fields": [{"name": "kind", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "ENUM", "name": "__TypeKind", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "name", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "fields", "description": null, "args": [{"name": "includeDeprecated", "description": null, "type": {"kind": "SCALAR", "name": "Boolean", "ofType": null}, "defaultValue": "false"}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Field", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "interfaces", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "possibleTypes", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "enumValues", "description": null, "args": [{"name": "includeDeprecated", "description": null, "type": {"kind": "SCALAR", "name": "Boolean", "ofType": null}, "defaultValue": "false"}], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__EnumValue", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "inputFields", "description": null, "args": [], "type": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__InputValue", "ofType": null}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "ofType", "description": null, "args": [], "type": {"kind": "OBJECT", "name": "__Type", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "ENUM", "name": "__TypeKind", "description": "An enum describing what kind of type a given `__Type` is", "fields": null, "inputFields": null, "interfaces": null, "enumValues": [{"name": "SCALAR", "description": "Indicates this type is a scalar.", "isDeprecated": false, "deprecationReason": null}, {"name": "OBJECT", "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", "isDeprecated": false, "deprecationReason": null}, {"name": "INTERFACE", "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", "isDeprecated": false, "deprecationReason": null}, {"name": "UNION", "description": "Indicates this type is a union. `possibleTypes` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "ENUM", "description": "Indicates this type is an enum. `enumValues` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "INPUT_OBJECT", "description": "Indicates this type is an input object. `inputFields` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "LIST", "description": "Indicates this type is a list. `ofType` is a valid field.", "isDeprecated": false, "deprecationReason": null}, {"name": "NON_NULL", "description": "Indicates this type is a non-null. `ofType` is a valid field.", "isDeprecated": false, "deprecationReason": null}], "possibleTypes": null}, {"kind": "OBJECT", "name": "__Field", "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "args", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__InputValue", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "type", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "isDeprecated", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "deprecationReason", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__InputValue", "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "type", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__Type", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "defaultValue", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__EnumValue", "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "isDeprecated", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "deprecationReason", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "OBJECT", "name": "__Directive", "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", "fields": [{"name": "name", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "String", "ofType": null}}, "isDeprecated": false, "deprecationReason": null}, {"name": "description", "description": null, "args": [], "type": {"kind": "SCALAR", "name": "String", "ofType": null}, "isDeprecated": false, "deprecationReason": null}, {"name": "locations", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "ENUM", "name": "__DirectiveLocation", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "args", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "LIST", "name": null, "ofType": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "OBJECT", "name": "__InputValue", "ofType": null}}}}, "isDeprecated": false, "deprecationReason": null}, {"name": "onOperation", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": true, "deprecationReason": "Use `locations`."}, {"name": "onFragment", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": true, "deprecationReason": "Use `locations`."}, {"name": "onField", "description": null, "args": [], "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "isDeprecated": true, "deprecationReason": "Use `locations`."}], "inputFields": null, "interfaces": [], "enumValues": null, "possibleTypes": null}, {"kind": "ENUM", "name": "__DirectiveLocation", "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", "fields": null, "inputFields": null, "interfaces": null, "enumValues": [{"name": "QUERY", "description": "Location adjacent to a query operation.", "isDeprecated": false, "deprecationReason": null}, {"name": "MUTATION", "description": "Location adjacent to a mutation operation.", "isDeprecated": false, "deprecationReason": null}, {"name": "SUBSCRIPTION", "description": "Location adjacent to a subscription operation.", "isDeprecated": false, "deprecationReason": null}, {"name": "FIELD", "description": "Location adjacent to a field.", "isDeprecated": false, "deprecationReason": null}, {"name": "FRAGMENT_DEFINITION", "description": "Location adjacent to a fragment definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "FRAGMENT_SPREAD", "description": "Location adjacent to a fragment spread.", "isDeprecated": false, "deprecationReason": null}, {"name": "INLINE_FRAGMENT", "description": "Location adjacent to an inline fragment.", "isDeprecated": false, "deprecationReason": null}, {"name": "SCHEMA", "description": "Location adjacent to a schema definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "SCALAR", "description": "Location adjacent to a scalar definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "OBJECT", "description": "Location adjacent to an object definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "FIELD_DEFINITION", "description": "Location adjacent to a field definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "ARGUMENT_DEFINITION", "description": "Location adjacent to an argument definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "INTERFACE", "description": "Location adjacent to an interface definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "UNION", "description": "Location adjacent to a union definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "ENUM", "description": "Location adjacent to an enum definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "ENUM_VALUE", "description": "Location adjacent to an enum value definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "INPUT_OBJECT", "description": "Location adjacent to an input object definition.", "isDeprecated": false, "deprecationReason": null}, {"name": "INPUT_FIELD_DEFINITION", "description": "Location adjacent to an input object field definition.", "isDeprecated": false, "deprecationReason": null}], "possibleTypes": null}], "directives": [{"name": "include", "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], "args": [{"name": "if", "description": "Included when true.", "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "defaultValue": null}]}, {"name": "skip", "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], "args": [{"name": "if", "description": "Skipped when true.", "type": {"kind": "NON_NULL", "name": null, "ofType": {"kind": "SCALAR", "name": "Boolean", "ofType": null}}, "defaultValue": null}]}]}} \ No newline at end of file