Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Jul 11, 2019

Conversation

designatednerd
Copy link
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
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
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
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
Contributor Author

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

@designatednerd
Copy link
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