Update Usage docs to use Result#669
Merged
designatednerd merged 5 commits intoapollographql:masterfrom Jul 25, 2019
Merged
Conversation
Also updates link to GraphQL Error spec
I put it everywhere else, might as well make it consistent.
|
@giladronat: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
giladronat
commented
Jul 25, 2019
| ``` | ||
|
|
||
| In addition to an optional `data` property, `result` contains an optional `errors` array with GraphQL errors (for more on this, see the sections on [error handling](https://facebook.github.io/graphql/#sec-Error-handling) and the [response format](https://facebook.github.io/graphql/#sec-Response-Format) in the GraphQL specification). | ||
| In addition to an optional `data` property, `success(Success)` result case contains an optional `errors` array with GraphQL errors (for more on this, see the sections on [response format errors](https://graphql.github.io/graphql-spec/June2018/#sec-Errors) in the GraphQL specification). |
Contributor
Author
There was a problem hiding this comment.
This link may need to be updated in the future, but the past one redirects to the spec home page which is less useful.
designatednerd
approved these changes
Jul 25, 2019
Contributor
designatednerd
left a comment
There was a problem hiding this comment.
🌠Excellent change - thanks for changing this!
Contributor
|
@giladronat Can you please sign the CLA so I can merge this? |
Contributor
Author
|
Done! Was confused by what's Meteor so didn't know if it was necessary. |
Contributor
|
Meteor Development Group is our...I guess parent company? Corporate legal entity? The thing on work documents I have to sign. Anyway yep, that's us. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I set up Apollo for the first time, got hit by the new
Result#644 Generic Parameter "Query" could not be inferred, and went to check the Usage docs to see what I was doing wrong. Later found out the cause, and decided to update the docs to reflect the change. I changed everything that previously used the(result, error)to the new Result.I used
guard let data = try? result.get().data else { return }liberally as the easiest happy path just-give-me-data in most places, while including an example on handling actual errors of bothGraphQLResultandResult.failure. Feel free to change it to any other way to get the data that may be more readable -- I'm still new toResult.