A Swift implementation of the GraphQL specification for building and executing GraphQL schemas on macOS and Linux.
GraphQLSwift/GraphQL is a Swift implementation of the GraphQL query language specification, providing the core runtime for defining schemas, executing queries, and handling subscriptions. It solves the need for a native, type-safe GraphQL foundation in Swift applications, enabling developers to build GraphQL APIs with Swift's concurrency and safety features.
Swift developers building GraphQL APIs for macOS or Linux, particularly those using server-side frameworks like Vapor or Hummingbird who need a low-level GraphQL implementation.
Developers choose this library for its strict adherence to the GraphQL spec, seamless integration with Swift's modern concurrency model, and its role as the underlying engine for popular Swift GraphQL tools like Graphiti and graphql-vapor.
The Swift GraphQL implementation for macOS and Linux
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ensures GraphQL specification adherence, including serialized map ordering via GraphQLJSONEncoder, preventing violations with standard JSON encoders as highlighted in the README.
Leverages Swift's async/await and AsyncSequence for subscriptions, providing modern, efficient handling of asynchronous operations, as demonstrated in the subscription example with AsyncThrowingStream.
Serves as the core runtime for higher-level Swift GraphQL tools like Graphiti and graphql-vapor, enabling a cohesive development stack, as recommended in the README for easier schema creation.
Utilizes Swift's type system to define GraphQL schemas with GraphQLObjectType and GraphQLField, reducing runtime errors through compile-time safety, though it requires verbose boilerplate.
Requires manual instantiation of GraphQLObjectType and GraphQLField for each schema element, leading to significant boilerplate code compared to higher-level abstractions like Graphiti.
Necessitates the use of GraphQLJSONEncoder instead of standard JSONEncoder to maintain spec compliance, adding complexity to result serialization, as admitted in the README to avoid field order violations.
Focuses solely on core GraphQL execution without built-in HTTP serving or schema generation, forcing integration with external libraries for full API deployment, as noted in the README's recommendations.