Skip to content

Commit 9f2eced

Browse files
feat: Adds example from graphql.org
1 parent b2221fe commit 9f2eced

6 files changed

Lines changed: 1254 additions & 0 deletions

File tree

Examples/GraphQLDotOrg/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc

Examples/GraphQLDotOrg/Package.resolved

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "GraphQLDotOrg",
7+
platforms: [
8+
.macOS(.v13),
9+
],
10+
products: [
11+
.library(
12+
name: "GraphQLDotOrg",
13+
targets: ["GraphQLDotOrg"]
14+
),
15+
],
16+
dependencies: [
17+
.package(name: "graphql-generator", path: "../.."),
18+
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "4.0.0"),
19+
],
20+
targets: [
21+
.target(
22+
name: "GraphQLDotOrg",
23+
dependencies: [
24+
.product(name: "GraphQL", package: "GraphQL"),
25+
.product(name: "GraphQLGeneratorRuntime", package: "graphql-generator"),
26+
],
27+
plugins: [
28+
.plugin(name: "GraphQLGeneratorPlugin", package: "graphql-generator"),
29+
]
30+
),
31+
]
32+
)

Examples/GraphQLDotOrg/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GraphQL.org
2+
3+
This is an example using the example schema at https://graphql.org/graphql/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Pacakge must define `GraphQLContext` type
2+
actor GraphQLContext { }
3+
4+
// The rest of the types should be implemented:
5+
6+
// struct Resolvers {
7+
// typealias Query = Root
8+
// }
9+
// struct Root {
10+
// ...
11+
// }

0 commit comments

Comments
 (0)