Introduction
Overview
SwiftGraphQL is a GraphQL Client that ships with a type-safe query builder. It lets you perform queries, mutations and listen for subscriptions.
The library is centered around three core principles:
- π If your project compiles, your queries work.
- π¦ Use Swift in favour of GraphQL wherever possible.
- π We donβt lock you into the framework.
You may choose to only use parts of the library (e.g. only the client but not the query builder, or only the websocket client), but you may also choose to use the entire library.
GraphQL Client
SwiftGraphQLClient is heavily inspired by urql
GraphQL client in the JavaScript community. It models the queries as streams of values and lets you create custom operation processors called exchanges.
WebSocket Client
GraphQLWebSocket is an implementation of GraphQL over WebSocket client conforming to the GraphQL over WebSocket protocol specification widely supported by GraphQL servers.
Query Builder
The query builder guarantees that every query you can create is valid and complies with the GraphQL spec. Additionally, it lets you write queries as Swift functions and process the data during the selection process.
What Now
Depending on how confident you are about using SwiftGraphQL I recommend reading either
- Why SwiftGraphQL to learn what pain points it solves, or
- Installation instructions to start using it.