-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
`Map.decode(_)` and Documentation fixed
- Loading branch information
Showing
13 changed files
with
81 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default () => { | ||
return ( | ||
<div className="flex flex-row items-center justify-center w-full"> | ||
<img className="w-32 hidden md:block md:w-40" src="/pioneer.png" /> | ||
<div className="flex flex-col items-center md:items-start justify-center"> | ||
<h1 className="font-extrabold text-4xl md:text-5xl mt-8">Pioneer</h1> | ||
<span className="text-lg my-5 text-gray-600 md:!text-2xl"> | ||
GraphQL server for Swift | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Map+Decoder.swift | ||
// pioneer | ||
// | ||
// Created by d-exclaimation on 22:20. | ||
// | ||
|
||
import class Foundation.JSONEncoder | ||
import class Foundation.JSONDecoder | ||
import enum GraphQL.Map | ||
|
||
public extension Map { | ||
/// Decode this map into a parseable value | ||
/// - Parameter dataType: The type to decode into | ||
/// - Returns: The decoded value | ||
func decode<T: Decodable>(_ dataType: T.Type) throws -> T { | ||
let data = try JSONEncoder().encode(self) | ||
return try JSONDecoder().decode(dataType, from: data) | ||
} | ||
} | ||
|
||
public extension Payload { | ||
/// Decode this payload into a parseable value | ||
/// - Parameter dataType: The type to decode into | ||
/// - Returns: The decoded value | ||
func decode<T: Decodable>(_ dataType: T.Type) throws -> T { | ||
let data = try JSONEncoder().encode(self) | ||
return try JSONDecoder().decode(dataType, from: data) | ||
} | ||
} |