Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated backend and fixed UI #4

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
43 changes: 43 additions & 0 deletions apollo-codegen-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"schemaNamespace" : "gameAPI",
"input" : {
"operationSearchPaths" : [
"**/*.graphql"
],
"schemaSearchPaths" : [
"**/*.graphqls"
]
},
"schemaDownloadConfiguration": {
"downloadMethod": {
"introspection": {
"endpointURL": "http://localhost:5000/graphql",
"httpMethod": {
"POST": {}
},
"includeDeprecatedInputValues": false,
"outputFormat": "SDL"
}
},
"downloadTimeout": 60,
"headers": [],
"outputPath": "./score-ios/Models/GraphQL/schema.graphqls"
},
"output" : {
"testMocks" : {
"none" : {
}
},
"schemaTypes" : {
"path" : "./gameAPI",
"moduleType" : {
"swiftPackageManager" : {
}
}
},
"operations" : {
"inSchemaModule" : {
}
}
}
}
Binary file added apollo-ios-cli
Binary file not shown.
Binary file added gameAPI/.DS_Store
Binary file not shown.
28 changes: 28 additions & 0 deletions gameAPI/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version:5.9

import PackageDescription

let package = Package(
name: "GameAPI",
platforms: [
.iOS(.v12),
.macOS(.v10_14),
.tvOS(.v12),
.watchOS(.v5),
],
products: [
.library(name: "GameAPI", targets: ["GameAPI"]),
],
dependencies: [
.package(url: "https://github.com/apollographql/apollo-ios.git", from: "1.0.0"),
],
targets: [
.target(
name: "GameAPI",
dependencies: [
.product(name: "ApolloAPI", package: "apollo-ios"),
],
path: "./Sources"
),
]
)
Binary file added gameAPI/Sources/.DS_Store
Binary file not shown.
Binary file added gameAPI/Sources/Operations/.DS_Store
Binary file not shown.
96 changes: 96 additions & 0 deletions gameAPI/Sources/Operations/Queries/GamesQuery.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// @generated
// This file was automatically generated and should not be edited.

@_exported import ApolloAPI

public class GamesQuery: GraphQLQuery {
public static let operationName: String = "Games"
public static let operationDocument: ApolloAPI.OperationDocument = .init(
definition: .init(
#"query Games { games { __typename id city date gender location opponentId result sport state time scoreBreakdown boxScore { __typename team period time description scorer assist scoreBy corScore oppScore } } }"#
))

public init() {}

public struct Data: GameAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }

public static var __parentType: any ApolloAPI.ParentType { GameAPI.Objects.Query }
public static var __selections: [ApolloAPI.Selection] { [
.field("games", [Game?]?.self),
] }

public var games: [Game?]? { __data["games"] }

/// Game
///
/// Parent Type: `GameType`
public struct Game: GameAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }

public static var __parentType: any ApolloAPI.ParentType { GameAPI.Objects.GameType }
public static var __selections: [ApolloAPI.Selection] { [
.field("__typename", String.self),
.field("id", String?.self),
.field("city", String.self),
.field("date", String.self),
.field("gender", String.self),
.field("location", String?.self),
.field("opponentId", String.self),
.field("result", String?.self),
.field("sport", String.self),
.field("state", String.self),
.field("time", String?.self),
.field("scoreBreakdown", [[String?]?]?.self),
.field("boxScore", [BoxScore?]?.self),
] }

public var id: String? { __data["id"] }
public var city: String { __data["city"] }
public var date: String { __data["date"] }
public var gender: String { __data["gender"] }
public var location: String? { __data["location"] }
public var opponentId: String { __data["opponentId"] }
public var result: String? { __data["result"] }
public var sport: String { __data["sport"] }
public var state: String { __data["state"] }
public var time: String? { __data["time"] }
public var scoreBreakdown: [[String?]?]? { __data["scoreBreakdown"] }
public var boxScore: [BoxScore?]? { __data["boxScore"] }

/// Game.BoxScore
///
/// Parent Type: `BoxScore`
public struct BoxScore: GameAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }

public static var __parentType: any ApolloAPI.ParentType { GameAPI.Objects.BoxScore }
public static var __selections: [ApolloAPI.Selection] { [
.field("__typename", String.self),
.field("team", String?.self),
.field("period", String?.self),
.field("time", String?.self),
.field("description", String?.self),
.field("scorer", String?.self),
.field("assist", String?.self),
.field("scoreBy", String?.self),
.field("corScore", Int?.self),
.field("oppScore", Int?.self),
] }

public var team: String? { __data["team"] }
public var period: String? { __data["period"] }
public var time: String? { __data["time"] }
public var description: String? { __data["description"] }
public var scorer: String? { __data["scorer"] }
public var assist: String? { __data["assist"] }
public var scoreBy: String? { __data["scoreBy"] }
public var corScore: Int? { __data["corScore"] }
public var oppScore: Int? { __data["oppScore"] }
}
}
}
}
54 changes: 54 additions & 0 deletions gameAPI/Sources/Operations/Queries/GetTeamByIdQuery.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// @generated
// This file was automatically generated and should not be edited.

@_exported import ApolloAPI

public class GetTeamByIdQuery: GraphQLQuery {
public static let operationName: String = "GetTeamById"
public static let operationDocument: ApolloAPI.OperationDocument = .init(
definition: .init(
#"query GetTeamById($id: String!) { team(id: $id) { __typename id color image name } }"#
))

public var id: String

public init(id: String) {
self.id = id
}

public var __variables: Variables? { ["id": id] }

public struct Data: GameAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }

public static var __parentType: any ApolloAPI.ParentType { GameAPI.Objects.Query }
public static var __selections: [ApolloAPI.Selection] { [
.field("team", Team?.self, arguments: ["id": .variable("id")]),
] }

public var team: Team? { __data["team"] }

/// Team
///
/// Parent Type: `TeamType`
public struct Team: GameAPI.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }

public static var __parentType: any ApolloAPI.ParentType { GameAPI.Objects.TeamType }
public static var __selections: [ApolloAPI.Selection] { [
.field("__typename", String.self),
.field("id", String?.self),
.field("color", String.self),
.field("image", String?.self),
.field("name", String.self),
] }

public var id: String? { __data["id"] }
public var color: String { __data["color"] }
public var image: String? { __data["image"] }
public var name: String { __data["name"] }
}
}
}
Binary file added gameAPI/Sources/Schema/.DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions gameAPI/Sources/Schema/Objects/BoxScore.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @generated
// This file was automatically generated and should not be edited.

import ApolloAPI

public extension Objects {
/// A GraphQL type representing a boxscore.
///
/// Attributes:
static let BoxScore = ApolloAPI.Object(
typename: "BoxScore",
implementedInterfaces: []
)
}
23 changes: 23 additions & 0 deletions gameAPI/Sources/Schema/Objects/GameType.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @generated
// This file was automatically generated and should not be edited.

import ApolloAPI

public extension Objects {
/// A GraphQL type representing a game.
///
/// Attributes:
/// - `id`: The ID of the game (optional).
/// - `city`: The city of the game.
/// - `date`: The date of the game.
/// - `gender`: The gender of the game.
/// - `location`: The location of the game.
/// - `opponent_id`: The id of the opposing team.
/// - `sport`: The sport of the game.
/// - `state`: The state of the game.
/// - `time`: The time of the game.
static let GameType = ApolloAPI.Object(
typename: "GameType",
implementedInterfaces: []
)
}
11 changes: 11 additions & 0 deletions gameAPI/Sources/Schema/Objects/Query.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @generated
// This file was automatically generated and should not be edited.

import ApolloAPI

public extension Objects {
static let Query = ApolloAPI.Object(
typename: "Query",
implementedInterfaces: []
)
}
18 changes: 18 additions & 0 deletions gameAPI/Sources/Schema/Objects/TeamType.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// @generated
// This file was automatically generated and should not be edited.

import ApolloAPI

public extension Objects {
/// A GraphQL type representing a team.
///
/// Attributes:
/// - `id`: The ID of the team (optional).
/// - `color`: The color of the team.
/// - `image`: The image of the team (optional).
/// - `name`: The name of the team.
static let TeamType = ApolloAPI.Object(
typename: "TeamType",
implementedInterfaces: []
)
}
15 changes: 15 additions & 0 deletions gameAPI/Sources/Schema/SchemaConfiguration.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// @generated
// This file was automatically generated and can be edited to
// provide custom configuration for a generated GraphQL schema.
//
// Any changes to this file will not be overwritten by future
// code generation execution.

import ApolloAPI

public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration {
public static func cacheKeyInfo(for type: ApolloAPI.Object, object: ApolloAPI.ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
}
34 changes: 34 additions & 0 deletions gameAPI/Sources/Schema/SchemaMetadata.graphql.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// @generated
// This file was automatically generated and should not be edited.

import ApolloAPI

public protocol SelectionSet: ApolloAPI.SelectionSet & ApolloAPI.RootSelectionSet
where Schema == GameAPI.SchemaMetadata {}

public protocol InlineFragment: ApolloAPI.SelectionSet & ApolloAPI.InlineFragment
where Schema == GameAPI.SchemaMetadata {}

public protocol MutableSelectionSet: ApolloAPI.MutableRootSelectionSet
where Schema == GameAPI.SchemaMetadata {}

public protocol MutableInlineFragment: ApolloAPI.MutableSelectionSet & ApolloAPI.InlineFragment
where Schema == GameAPI.SchemaMetadata {}

public enum SchemaMetadata: ApolloAPI.SchemaMetadata {
public static let configuration: any ApolloAPI.SchemaConfiguration.Type = SchemaConfiguration.self

public static func objectType(forTypename typename: String) -> ApolloAPI.Object? {
switch typename {
case "BoxScore": return GameAPI.Objects.BoxScore
case "GameType": return GameAPI.Objects.GameType
case "Query": return GameAPI.Objects.Query
case "TeamType": return GameAPI.Objects.TeamType
default: return nil
}
}
}

public enum Objects {}
public enum Interfaces {}
public enum Unions {}
Loading