Skip to content

Update documentation to show how to use new delegates and cache policy#618

Merged
designatednerd merged 6 commits intomasterfrom
add/docs-on-a-plane
Jul 11, 2019
Merged

Update documentation to show how to use new delegates and cache policy#618
designatednerd merged 6 commits intomasterfrom
add/docs-on-a-plane

Conversation

@designatednerd
Copy link
Copy Markdown
Contributor

In this PR:

  • Added instructions and example code on how to use the new sub-protocols of HTTPTransportClientDelegate that came out with v0.11.0
  • Got rid of recommendation to use the app delegate as a singleton and just make an actual singleton object instead
  • Updated fetching-queries.md to include information about using GET for queries and add the most recent cache policy addition.
  • Fixed a 🤦‍♀️with inline documentation

```swift
let apollo = ApolloClient(url: URL(string: "http://localhost:8080/graphql")!)
class Apollo {
static let shared = Apollo()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a singleton class really needed? What is the benefit over a global variable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, too fast, I see the example below with the delegate implementations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that plus I'm very much team "If you're gonna use a singleton, use a singleton. Don't use the App Delegate as a pseudo-singleton as that's not what it's for."

@designatednerd
Copy link
Copy Markdown
Contributor Author

Also removed old link to CocoaDocs (which is dead) and fixed some stray whitespace in the iOS build script.

@designatednerd
Copy link
Copy Markdown
Contributor Author

I guess this is an approval?

Screen Shot 2019-07-11 at 5 40 07 PM

😃 Merging.

@designatednerd designatednerd merged commit 4b49977 into master Jul 11, 2019
@designatednerd designatednerd deleted the add/docs-on-a-plane branch July 11, 2019 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants