Skip to content

Commit 775d09f

Browse files
feat: Creates real StarWars example
1 parent 6e938f1 commit 775d09f

15 files changed

Lines changed: 1600 additions & 80 deletions

File tree

Examples/GraphQLDotOrg/Package.resolved

Lines changed: 0 additions & 33 deletions
This file was deleted.

Examples/GraphQLDotOrg/Package.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

Examples/GraphQLDotOrg/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

Examples/GraphQLDotOrg/Sources/GraphQLDotOrg/GraphQLDotOrg.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.

Examples/StarWars/Package.resolved

Lines changed: 231 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/StarWars/Package.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "StarWars",
7+
platforms: [
8+
.macOS(.v13),
9+
],
10+
products: [
11+
.library(
12+
name: "StarWars",
13+
targets: ["StarWars"]
14+
),
15+
],
16+
dependencies: [
17+
.package(name: "graphql-generator", path: "../.."),
18+
.package(url: "https://github.com/GraphQLSwift/DataLoader", from: "2.0.0"),
19+
.package(url: "https://github.com/GraphQLSwift/GraphQL", from: "4.1.0"),
20+
.package(url: "https://github.com/swift-server/async-http-client", from: "1.0.0"),
21+
],
22+
targets: [
23+
.target(
24+
name: "StarWars",
25+
dependencies: [
26+
.product(name: "AsyncDataLoader", package: "DataLoader"),
27+
.product(name: "AsyncHTTPClient", package: "async-http-client"),
28+
.product(name: "GraphQL", package: "GraphQL"),
29+
.product(name: "GraphQLGeneratorRuntime", package: "graphql-generator"),
30+
],
31+
plugins: [
32+
.plugin(name: "GraphQLGeneratorPlugin", package: "graphql-generator"),
33+
]
34+
),
35+
.testTarget(
36+
name: "StarWarsTests",
37+
dependencies: [
38+
"StarWars",
39+
]
40+
),
41+
]
42+
)

Examples/StarWars/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Star Wars
2+
3+
This is an example using the example schema at https://graphql.org/graphql/, which integrates to the Star Wars API: https://www.swapi.tech.
4+
For a Javascript implementation, see https://github.com/graphql/swapi-graphql

0 commit comments

Comments
 (0)