Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Bump version to 0.4.0, add CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov committed Apr 7, 2019
1 parent 6f92e02 commit 8300657
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 21 deletions.
4 changes: 2 additions & 2 deletions ApolloAlamofire.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'ApolloAlamofire'
s.version = '0.3.0'
s.version = '0.4.0'
s.summary = 'Alamofire transport for Apollo iOS GraphQL library'

# This description is used to generate tags and improve search results.
Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!

s.swift_version = '4.1'
s.swift_version = '4.2'
s.description = <<-DESC
This package bundles a `NetworkTransport` implementation that wraps Alamofire
and solves known limitations of Apollo iOS library.
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Change Log

## [0.4.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.3.0) (2019-04-07)

This update fixes compatibility with Xcode 10.2 and Swift 5.0. This release
also supports Swift 4.2 and Xcode 10.0 and 10.1, but unfortunately maintaining
a suite of tests and Xcode project settings that support Swift 4.0 and Xcode 9
as well does not seem feasible (PRs that fix this are welcome!).

No other changes were made and ApolloAlamofire 0.3.0 is recommended if you need
Xcode 9 support.

**Closed issues:**

- Xcode 10.2 & Swift 5.0 compatibility [\#2](https://github.com/graphql-community/ApolloAlamofire/issues/2)
- Error in compilation [\#1](https://github.com/graphql-community/ApolloAlamofire/issues/1)

**Merged pull requests:**

- Add and apply SwiftFormat [\#4](https://github.com/graphql-community/ApolloAlamofire/pull/4) ([MaxDesiatov](https://github.com/MaxDesiatov))
- Add Xcode 10.2 to .travis.yml [\#3](https://github.com/graphql-community/ApolloAlamofire/pull/3) ([MaxDesiatov](https://github.com/MaxDesiatov))

## [0.3.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.3.0) (2018-09-13)

- Updated project for Swift 4.2 and Apollo 0.9.

## [0.2.1](https://github.com/graphql-community/ApolloAlamofire/tree/0.2.1) (2018-05-03)

- Added documentation for headers and logging properties.
- Improved README.md, added simple example code.

## [0.2.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.2.0) (2018-05-03)

- Public props in AlamofireTransport
- Added simple test, updated example dependencies
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ApolloAlamofire

### Alamofire transport implementation for Apollo GraphQL iOS library.
### Alamofire transport implementation for Apollo GraphQL iOS library.

[![CI Status](https://img.shields.io/travis/graphql-community/ApolloAlamofire/master.svg?style=flat)](https://travis-ci.org/MaxDesiatov/ApolloAlamofire)
[![Version](https://img.shields.io/cocoapods/v/ApolloAlamofire.svg?style=flat)](https://cocoapods.org/pods/ApolloAlamofire)
Expand All @@ -9,18 +9,18 @@

## What's This For?

If you've used [Apollo iOS](https://github.com/apollographql/apollo-ios) library,
If you used [Apollo iOS](https://github.com/apollographql/apollo-ios) library,
you may have stumbled upon a few limitations of a standard `HTTPNetworkTransport`
provided with the library:

* [Can't swap request headers without creating a new `ApolloClient` instance](https://github.com/apollographql/apollo-ios/issues/37)
* [Can't send requests when the app is in background](https://stackoverflow.com/questions/50089546/how-to-correctly-use-apollo-graphql-on-ios-with-background-session-configuration)
* [Can't log request/response data](https://github.com/apollographql/apollo-ios/pull/257)
- [Can't swap request headers without creating a new `ApolloClient` instance](https://github.com/apollographql/apollo-ios/issues/37)
- [Can't send requests when the app is in background](https://stackoverflow.com/questions/50089546/how-to-correctly-use-apollo-graphql-on-ios-with-background-session-configuration)
- [Can't log request/response data](https://github.com/apollographql/apollo-ios/pull/257)

Fortunately, Apollo iOS provides a public `NetworkTransport` protocol that allows
Fortunately, Apollo iOS provides a public `NetworkTransport` protocol that allows
us to override behaviour that's limited. Looks like [Alamofire](https://github.com/Alamofire/Alamofire)
is the most popular iOS networking library and all of the mentioned limitations can be solved
with it. You also probably use Alamofire anyway to acquire authentication tokens for your
is the most popular iOS networking library and all of the mentioned limitations can be solved
with it. You also probably use Alamofire anyway to acquire authentication tokens for your
GraphQL API, so it makes sense to integrate both Alamofire and Apollo iOS.

This package bundles a `NetworkTransport` implementation that wraps Alamofire
Expand All @@ -29,11 +29,14 @@ and solves these limitations.
## Example

When initialising a new `ApolloClient` instance instead of

```swift
let u = URL(string: "http://localhost:8080/graphql")!
let client = ApolloClient(url: u)
```

or instead of

```swift
let u = URL(string: "http://localhost:8080/graphql")!
let client = ApolloClient(networkTransport: HTTPNetworkTransport(url: u))
Expand All @@ -49,7 +52,7 @@ let u = URL(string: "http://localhost:8080/graphql")!
let client = ApolloClient(networkTransport: AlamofireTransport(url: u))
```

There are additional parameters available for `AlamofireTransport` initialiser, e.g. for
There are additional parameters available for `AlamofireTransport` initialiser, e.g. for
a background session you can use it like this:

```swift
Expand All @@ -62,7 +65,6 @@ let client = ApolloClient(networkTransport: t)

like this for auth headers:


```swift
let token = "blah"
let u = URL(string: "http://localhost:8080/graphql")!
Expand All @@ -81,11 +83,11 @@ let client = ApolloClient(networkTransport: t)

Both `headers` and `loggingEnabled` are also variable properties of `AlamofireTransport`.
This allows you to change headers without instantiating a new transport, e.g. when a user
logs out and a different user logs in you can swap authentication headers. If you switch
logging dynamically, `loggingEnabled` property can be controlled in the same way
logs out and a different user logs in you can swap authentication headers. If you switch
logging dynamically, `loggingEnabled` property can be controlled in the same way
without creating a new `AlamofireTransport` instance.

Nice feature of Alamofire is that request logging prints a ready for use
Nice feature of Alamofire is that request logging prints a ready for use
[curl command](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#curl-command-output), which you can directly copy and paste in terminal to test a request.

All of the initialiser parameters except `url` have sensible default values and can be used
Expand All @@ -95,20 +97,24 @@ To run the example project, clone the repo, and open `Example/ApolloAlamofire.xc

## Requirements

* Xcode 10.0 or later
* Swift 4.2 or later
- Xcode 10.0 or later
- Swift 4.2 or later
- iOS 9.0 deployment target or later.

If you integrate the library with CocoaPods, Alamofire and Apollo iOS
dependencies are pulled automatically. Currently tested compatible versions are
Alamofire 4.x and Apollo iOS 0.10.x.

If you integrate the library with CocoaPods, Alamofire and Apollo iOS dependencies are
pulled automatically. Currently tested versions that should be compatible are Alamofire 4.x
and Apollo iOS 0.10.x.
If you need Xcode 9 and Swift 4.0 support in your project you can use earlier
version of ApolloAlamofire: [0.3.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.3.0).

## Installation

ApolloAlamofire is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your target configuration in your Podfile:

```ruby
pod 'ApolloAlamofire'
pod 'ApolloAlamofire', '~> 0.4.0'
```

## Maintainer
Expand Down

0 comments on commit 8300657

Please sign in to comment.