Skip to content

Commit 6e938f1

Browse files
doc: Readme updates
1 parent 1d094d4 commit 6e938f1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ A Swift package plugin that generates server-side GraphQL API code from GraphQL
66

77
## Features
88

9+
- **Data-driven**: Guarantee conformance with declared GraphQL spec
910
- **Build-time code generation**: Code is generated at build time and doesn't need to be committed
1011
- **Type-safe**: Leverages Swift's type system for compile-time safety
1112
- **Minimal boilerplate**: Generates all GraphQL definition code - you write the business logic
13+
- **Flexible**: Makes no assumptions about backing data types other than GraphQL type conformance
1214

1315
## Installation
1416

1517
Add the package to your `Package.swift`. Be sure to add the `GraphQLGeneratorRuntime` dependency to your package, and add the `GraphQLGeneratorPlugin` to the plugins section:
1618

1719
```swift
1820
dependencies: [
19-
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "4.0.0"),
21+
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "4.1.0"),
2022
.package(url: "https://github.com/GraphQLSwift/graphql-generator", from: "1.0.0")
2123
],
2224
targets: [
@@ -83,9 +85,9 @@ As you build the `Query`, `Mutation`, and `Subscription` types and their resolut
8385

8486
```swift
8587
struct Query: GraphQLGenerated.Query {
86-
// This is required by `GraphQLGenerated.Query`, and used by GraphQL query resolution.
88+
// This is required by `GraphQLGenerated.Query`, and used by GraphQL query resolution
8789
static func user(context: GraphQLContext, info: GraphQLResolveInfo) async throws -> (any GraphQLGenerated.User)? {
88-
// You can implement resolution logic however you like.
90+
// You can implement resolution logic however you like
8991
return context.user
9092
}
9193
}
@@ -95,12 +97,12 @@ struct User: GraphQLGenerated.User {
9597
let name: String
9698
let email: String
9799

98-
// These are required by `GraphQLGenerated.User`, and used by GraphQL field resolution.
100+
// These are required by `GraphQLGenerated.User`, and used by GraphQL field resolution
99101
func name(context: GraphQLContext, info: GraphQLResolveInfo) async throws -> String {
100102
return name
101103
}
102104
func email(context: GraphQLContext, info: GraphQLResolveInfo) async throws -> GraphQLScalars.EmailAddress {
103-
// You can implement resolution logic however you like.
105+
// You can implement resolution logic however you like
104106
return .init(email: self.email)
105107
}
106108
}
@@ -111,9 +113,10 @@ struct User: GraphQLGenerated.User {
111113
```swift
112114
import GraphQL
113115

116+
// Build the auto-generated schema
114117
let schema = try buildGraphQLSchema(resolvers: Resolvers.self)
115118

116-
// Execute a query
119+
// Execute a query against it
117120
let result = try await graphql(schema: schema, request: "{ users { name email } }")
118121
print(result)
119122
```
@@ -218,8 +221,5 @@ extension GraphQLScalars {
218221

219222
## Development Roadmap
220223

221-
1. Directives: Directives are currently not supported
222-
223-
## Contributing
224-
225-
This project is in active development. Contributions are welcome!
224+
1. Add Directive support
225+
2. Add configuration to reference different `.graphql` source file locations.

0 commit comments

Comments
 (0)