Swiftpack.co - GraphQLSwift/GraphQL as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by GraphQLSwift.
GraphQLSwift/GraphQL 2.2.1
The Swift GraphQL implementation for macOS and Linux
⭐️ 865
🕓 20 weeks ago
.package(url: "https://github.com/GraphQLSwift/GraphQL.git", from: "2.2.1")


The Swift implementation for GraphQL, a query language for APIs created by Facebook.

Swift License Slack GitHub Actions Codebeat

Looking for help? Find resources from the community.


This repo only contains the core GraphQL implementation. For a better experience when creating your GraphQL schema use Graphiti.

Encoding Results

If you encode a GraphQLResult with an ordinary JSONEncoder, there are no guarantees that the field order will match the query, violating the GraphQL spec. To preserve this order, GraphQLResult should be encoded using the GraphQLJSONEncoder provided by this package.


Most of this repo mirrors the structure of the canonical GraphQL implementation written in Javascript/Typescript. If there is any feature missing, looking at the original code and "translating" it to Swift works, most of the time. For example:






This project is released under the MIT license. See LICENSE for details.


Stars: 865
Last commit: Yesterday
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.


Release Notes

2.2.1 - Avalanche Mountain
20 weeks ago

Adds a GraphQLRequest type

Merges: https://github.com/GraphQLSwift/GraphQL/pull/97

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics