Skip to content

preview-defer.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@calvincestari calvincestari released this 05 Jan 19:34
· 57 commits to main since this release

This is the first preview release of @defer support in Apollo iOS which focuses on providing early access to using the @defer directive in your operations. During preview releases bugs can occur, if you do experience anything unexpected please report it to us.

Note: Apollo supports a very specific early RFC version of the @defer directive as documented here. The @defer directive is still an RFC and is not an official addition to the GraphQL specification yet. This means that Apollo iOS may not work with all servers that currently support @defer.

How to use it
We have a sample schema/server that supports @defer and can be launched using the Docker configuration.

Once you have that service launched you can configure your Apollo iOS client to target the apollo-ios and apollo-ios-codegen dependency packages using the preview-defer.1 tag. Below is an example query using @defer against the schema.

query ExampleQuery {
  allProducts {
    sku
    id
    ... on Product @defer(label: "additional") {
      dimensions {
        size
      }
      variation {
        id
        name
      }
    }
  }
}

Alternatively here is a sample client to demonstrate the code generation and operation execution of the @defer directive.

Caveats in this preview release

  • Caching is intentionally disabled for operations using @defer.