Skip to content

Releases: apollographql/apollo-ios

1.0.0 Beta 2

16 Aug 20:56
28c6023
Compare
Choose a tag to compare
1.0.0 Beta 2 Pre-release
Pre-release

This is the second Beta Release of Apollo iOS 1.0. The Beta version has full feature parity with the 0.x.x releases. The API is expected to be mostly stable. Some breaking changes may occur due to user feedback prior to General Availability (GA) Release. The Beta does not have complete documentation or usage guides, which will be completed prior to GA.

This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • Breaking: Changed API for Cache Key Configuration: Cache Key Resolution is now easier to configure. See CacheKeyInfo for examples and documentation.
  • Breaking: Changed API for generated Schema Types to support dynamic types The API for generated schema types now initializes instances of Object, Interface, and Union for each corresponding type in your schema. These are still generated by the code generation engine. This differs from the previous API which generated static types that were subclasses of Object, Interface, and Union. The change provides the API to support the future addition of dynamic types added to your schema at runtime.
  • New: Codegen CLI will now automatically create output directories: You no longer are required to have already created all intermediary directories for your codegen output paths prior to running code generation.
  • New: CodegenCLI is built locally with CocoaPods installations: This is to ensure that the version of the Codegen CLI is the same as ApolloCodegenLib. This behavior will be extended to Swift Package Manager installations too.
  • New: Swift Keywords are escaped when used as names of fields or types in generated objects: Previously, using Swift keywords (eg. self, protocol, Type) as the names of fields in your operations or types in your schema would cause compilation errors in your generated code. Now, these names will be escaped with backticks to prevent compiler errors. The names __data and fragments cannot be used as field names as they conflict with Apollo's generated object APIs Using these names will result in a validation error being thrown when attempting to run the code generation engine.
  • Fixed: Fragments with lowercase names caused compilation errors: This bug is fixed. Fragments with lowercase names will be correctly uppercased when referencing the generated Fragment objects.
  • Fixed: Build errors in Xcode 14/Swift 5.7: The library was updated to support the Swift 5.7 language version. Swift 5.6 is still supported.
  • Fixed: Xcode 14 does not support Bitcode: Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.
  • Fixed: "No such module ApolloAPI" error when using CocoaPods: The podspec was not configured to import all required source files and some import statements were unnecessary in a CocoaPods environment. A code generation configuration option was added to order to ensure generated files are generated with the correct import statements in a CocoaPods environment. When generating code for a project that includes Apollo via Cocoapods, you must set the cocoapodsCompatibleImportStatements option to true in your ApolloCodegenConfiguration. When using the Codegen CLI that is built for you during pod install the apollo-ios-cli init command will default this option to true. When building the Codegen CLI in by other method, this option will default to false.
  • Removed: ApolloUtils target no longer necessary: The things that used to be shared here are actually no longer shared. There is no code shared between the Apollo and ApolloCodegenLib targets.
  • Removed: ApolloCodegenConfiguration.validation: This method was incorrectly requiring destination paths to exist before code generation. Once that was removed it was no longer necessary. Any errors that are encountered with destination output paths will be raised during code generation.

Release 0.53.0

29 Jul 12:35
42646f7
Compare
Choose a tag to compare
  • Remove all instances of bitcode as not supported in Xcode 14: Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14. #2398 - Thanks to @stareque-atlassian for the contribution!

Version 0.52.0

14 Jul 10:08
0c43e49
Compare
Choose a tag to compare
  • Add codegen option for excludes: There is a new property on the codegen configuration options to allow files matching the pattern to be excluded, in the case they are found in the includes path. #2205 - Thanks to @bannzai for the contribution!
  • Fixed - Using the graphql_transport_ws protocol could result in 4400 errors from the server: The correct protocol message is now being sent to the server to end communication. #2320
  • Replace print statement with CodegenLogger.log: All codegen output is logged with CodegenLogger which can be disabled if needed. #2348 - Thanks to @hiltonc for the contribution!
  • Expose GraphQLResultError path string: Adds a new publicly available computed property to GraphQLResultError which just exposes the path description. #2361 - Thanks to @joshuashroyer-toast for the contribution!

1.0.0 Beta 1

01 Jul 23:44
Compare
Choose a tag to compare
1.0.0 Beta 1 Pre-release
Pre-release

This is the first Beta Release of Apollo iOS 1.0. The Beta version has full feature parity with the 0.x.x releases. The API is expected to be mostly stable. Some breaking changes may occur due to user feedback prior to General Availability (GA) Release. The Beta does not have complete documentation or usage guides, which will be completed prior to GA.

This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • New: Additional Generated Code Output Configuration Options.
    • queryStringLiteralFormat: Configures how the generated operations render the operation document source. Either multi-line (as defined in operation definition) or minified to a single line.
    • schemaDocumentation: Documentation of fields and objects from your schema will now be included as in-line documentation on generated objects. This can be disabled by setting schemaDocumentation to .excluded in your codegen configuration.
    • warningsOnDeprecatedUsage: Adds warning annotation when using fields and arguments in generated operations that are deprecated by the schema.
    • additionalInflectionRules: Allows you to configure custom singularization rules for generated fields names.
  • New: Support Automatic Persisted Queries: APQs are now fully functional. Note: Legacy operation safelisting support may experience issues in some cases. If you have problems using operation safelisting, please create an issue so that we may understand and resolve the edge cases in the safelisting process.
  • Fixed: Singularization of plural names for non-list fields.
  • Fixed: Runtime failure on execution of operations with InputObjects.
  • Fixed: __typename field no longer generated when manually included: __typename is automatically included in all operations and fragments and has a default property on all Selection Sets. Generating the field was redundant and caused compilation errors.

1.0.0 Alpha 8

27 Jun 18:34
a3e88eb
Compare
Choose a tag to compare
1.0.0 Alpha 8 Pre-release
Pre-release

This is the eighth Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • New: Added Equatable and Hashable Conformance to public API Models: Object's like GraphQLRequest and GraphQLError now can be compared!
  • New: Code Generation now supports Schema Extensions.
  • Fixed: Namespacing and Access Control on Generated Models: Generated models were failing to compile due to namespacing and access control issues in certain code generation configurations. This is fixed now!
  • Improved: Custom Scalar Default Float Behavior: If the response for a custom scalar is provided as a Float, it will automatically be converetd to a String (just like it's always done for Int).
  • Improved: GraphQL Float now treated as Swift Double: The Float defined in the GraphQL spec is actually compliant with a Swift Double. Generated code will now generate Swift code with fields of type Double for GraphQL Float.
  • Improved: Rename SelectionSet.data to SelectionSet.__data: This is to prevent naming conflicts with GraphQL fields named data.
  • Fixed: graphql_transport_ws protocol now sends 'complete' to end subscription: The protocol implementation was previously sending the wrong message to close the connection.
  • Improved: Generated Operations Folder Structure: The generated output folder structure for fragments and operations are now organized into sub-folders.
  • New: Introspection Schema Download can output JSON: Schema downloads via Introspection now support output as JSON instead of only SDL. Note that Apollo Registry schema downloads still only support SDL as the output.

1.0.0 Alpha 7

15 Jun 00:01
1250517
Compare
Choose a tag to compare
1.0.0 Alpha 7 Pre-release
Pre-release

This is the seventh Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • New: Local Cache Mutations are now supported: In order to perform a local cache mutation, define a .graphql file with an operation or a fragment and mark it with the directive @apollo_client_ios_localCacheMutation. This will ensure the code generator generates a mutable cache mutation operation.
    • Note: Local Cache Mutation operations cannot be used for fetching from the network! You should define separate GraphQL operations for network operations and local cache mutations.
    • Example Usage:
/// SampleLocalCacheMutation.graphql
query SampleLocalCacheMutation @apollo_client_ios_localCacheMutation {
  allAnimals {
    species
    skinCovering
    ... on Bird {
      wingspan
    }
  }
}

/// SampleLocalCacheMutationFragment.graphql
fragment SampleLocalCacheMutationFragment on Pet @apollo_client_ios_localCacheMutation {
  owner {
    firstName
  }
}
  • New: Support Code Generation Configuration Option: deprecatedEnumCases: If deprecatedEnumCases is set to exclude, deprecated cases in graphql enums from your schema will not be generated and will be treated as unknown enum values.
  • Fixed - Compilation Errors in Generated Code When Schema was Embedded In Target: When embedding the generated schema in your own target, rather than generating a separate module for it, there were compilation errors due to access control and namespacing issues. These are resolved. This fixes #2301 & #2302. Thanks @kimdv for calling attention to these bugs!
    • Note: Compilation Errors for Test Mocks are still present. We are aware of ongoing issues with generated test mocks. We are actively working on fixing these issues and they will be resolved in a future alpha release soon.
  • Fixed: Crash When Accessing a Conditionally Included Fragment That is Nil. This is fixed now and will return nil as it should. This fixes #2310.

1.0.0 Alpha 6

07 Jun 17:29
11bc60d
Compare
Choose a tag to compare
1.0.0 Alpha 6 Pre-release
Pre-release

This is the sixth Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • New - Objects and InputObjects are now equatable: Many objects now conform to AnyHashable bringing with them the ability to conform to Equatable, this should make tests easier to write.
  • Change - GraphQLOperation fields are now static: Previously an instance of a GraphQLOperation was required to query any of it's properties, you can do that on the type now.
  • Fixed - Nested fragment type cases: Nested fragment type cases were not being generated causing a crash in selection set generation.
  • New - Code generation now has a CLI: A new command line executable has been built and will be available on Homebrew very soon! Check it out here.
  • Fixed - SelectionSet and InlineFragment protocol definitions: These were incorrectly being generated within the namespace when a module of type .embeddedInTarget was being used.
  • Fixed - Test mock convenience initializers: These were incorrectly defining parameter types for Interface and Union fields and the generated package could not successfully build.

1.0.0 Alpha 5

19 May 19:38
69e372f
Compare
Choose a tag to compare
1.0.0 Alpha 5 Pre-release
Pre-release

This is the fifth Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • Test Mocks are now supported!
    • Test mocks can be generated to make it much easier to create mocks of your generated selection sets for unit testing.
    • This long requested feature can be enabled in your code generation config with the option config.output.testMocks.
    • Once you've generated test mocks, import the new ApolloTestSupport target (as well as your generated mocks) in your unit tests to start.
    • More documentation for test mocks will be coming soon. In the mean time, here is some example usage:
let mockDog = Mock<Dog>()
mock.species = "Canine"
mock.height = Mock<Height>(feet: 3, inches: 6)

// To mock an object in a generated operation:
let generatedDogMock: AnimalQuery.Data.Animal = AnimalQuery.Data.Animal.mock(from: mockDog)

// To mock an entire query:
let queryMock = Mock<Query>()
queryMock.animals = [mockDog]
let generatedSelectionSetMock: AnimalQuery.Data = AnimalQuery.Data.mock(from: queryMock)
  • GraphQLNullable and GraphQLEnum from the ApolloAPI target are now exported by your generated operations. This prevents you from having to import ApolloAPI everywhere that you are consuming your generated models.
  • CacheKeyProvider now supports grouping multiple types that share key uniqueness.
  • Lots of performance improvements
    • Using StaticString instead of String in generated files.
    • Added @inlinable to many ApolloAPI functions consumed by generated code.
    • And more!

1.0.0 Alpha 4

15 Apr 20:38
Compare
Choose a tag to compare
1.0.0 Alpha 4 Pre-release
Pre-release

This is the fourth Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • Client Controlled Nullability (CCN) is now supported!
    • CCN is an experimental new feature addition to GraphQL. This feature allows you to override the optionality of fields from a schema in your client operations. CCN can help you create cleaner generated models that require less optional unwrapping.
    • You can read more about CCN here.
    • Because CCN is an experimental feature, the API is subject to change before its final release.
    • Apollo iOS 1.0.0 is the first client to provide support for this new functionality! Huge thanks to @twof!
  • Fixed - Names of generated objects are now correctly uppercased.
  • Fixed - Names of inline fragments with inclusion conditions were sometimes generated incorrectly.
  • Fixed - __typename field is now selected by executor on all entities automatically.

1.0.0 Alpha 3

12 Apr 00:58
Compare
Choose a tag to compare
1.0.0 Alpha 3 Pre-release
Pre-release

This is the third Alpha Release of Apollo iOS 1.0. This first major version will include a new code generation engine, better generated models, and many syntax and performance improvements across the entire library. The primary goal of Apollo iOS 1.0 is to stabilize the API of the model layer and provide a foundation for future feature additions and evolution of the library.

  • Include/Skip Directives are now supported!
    • Adding @include/@skip directives to fields, inline fragments, or fragment spreads will now generate code that respects the optionality of these conditionally included selections.
  • Changed - Generated TypeCase renamed to InlineFragment These are now used for both type cases and inline fragments that are conditionally included using @include/@skip directives.
  • Custom Scalars are now supported!
    • Template Files will be generated for custom scalars. The template files typealias each custom scalar to a String by default. These generated files can be edited to provide custom functionality for advanced custom scalars. Custom scalar template files that have been edited will not be overwritten on later code generation executions.
  • Improved multi-module support
    • Including your generated code using package managers other than SPM can be done using the .other option for moduleType in your code generation configuration.
  • Nil Coalescing Operator added to GraphQLNullable
    • This allows for optional variables to easily be used with GraphQLNullable parameters and a default value
var myVar: GraphQLNullable<String>
let optionalString: String?

// Before
myVar = optionalString.map { .some($0) } ?? .none

// After
myVar = optionalString ?? .none
  • Fixed - fragments not accessible on generated SelectionSets.
  • Fixed - __typename is now added to all operation and fragment definitions.
  • Fixed - Missing Generated Interface Types
    • Interface types that were only referenced as an implemented interface of a referenced concrete type were not being generated previously.