Skip to content
Merged
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
33 changes: 0 additions & 33 deletions Examples/GraphQLDotOrg/Package.resolved

This file was deleted.

32 changes: 0 additions & 32 deletions Examples/GraphQLDotOrg/Package.swift

This file was deleted.

3 changes: 0 additions & 3 deletions Examples/GraphQLDotOrg/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions Examples/GraphQLDotOrg/Sources/GraphQLDotOrg/GraphQLDotOrg.swift

This file was deleted.

File renamed without changes.
231 changes: 231 additions & 0 deletions Examples/StarWars/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions Examples/StarWars/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// swift-tools-version: 6.0

import PackageDescription

let package = Package(
name: "StarWars",
platforms: [
.macOS(.v13),
],
products: [
.library(
name: "StarWars",
targets: ["StarWars"]
),
],
dependencies: [
.package(name: "graphql-generator", path: "../.."),
.package(url: "https://github.com/GraphQLSwift/DataLoader", from: "2.0.0"),
.package(url: "https://github.com/GraphQLSwift/GraphQL", from: "4.1.0"),
.package(url: "https://github.com/swift-server/async-http-client", from: "1.0.0"),
],
targets: [
.target(
name: "StarWars",
dependencies: [
.product(name: "AsyncDataLoader", package: "DataLoader"),
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "GraphQL", package: "GraphQL"),
.product(name: "GraphQLGeneratorRuntime", package: "graphql-generator"),
],
plugins: [
.plugin(name: "GraphQLGeneratorPlugin", package: "graphql-generator"),
]
),
.testTarget(
name: "StarWarsTests",
dependencies: [
"StarWars",
]
),
]
)
15 changes: 15 additions & 0 deletions Examples/StarWars/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Star Wars

This is a `graphql-generator` example using the schema at https://graphql.org/graphql/, which wraps the [Star Wars API](https://www.swapi.tech) (SWAPI). For a Javascript implementation, see https://github.com/graphql/swapi-graphql

It uses [async-http-client](https://github.com/swift-server/async-http-client) to make the web requests and a [DataLoader](https://github.com/GraphQLSwift/DataLoader) to cache SWAPI responses.

## Getting Started

To get started, simply open this directory and build the project:

```swift
swift build
```

Running the tests will print some example query responses to the console.
Loading