Skip to content

Add extensions property to GraphQLResult.#1370

Merged
designatednerd merged 2 commits intoapollographql:mainfrom
paulkite:add-extensions-to-graphqlresult
Aug 31, 2020
Merged

Add extensions property to GraphQLResult.#1370
designatednerd merged 2 commits intoapollographql:mainfrom
paulkite:add-extensions-to-graphqlresult

Conversation

@paulkite
Copy link
Copy Markdown
Contributor

  • Added extensions property to GraphQLResult.
  • Updated references.
  • Implemented tests in ParseQueryResponseTests.

Addresses issue: 1348

- Updated references.
- Implemented tests in ParseQueryResponseTests.
@apollo-cla
Copy link
Copy Markdown

@paulkite: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link
Copy Markdown
Contributor

@designatednerd designatednerd left a comment

Choose a reason for hiding this comment

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

Hi! Sorry I was on vacation last week. Mostly looks good, just one thought.

Comment thread Sources/Apollo/GraphQLResponse.swift Outdated
let data = try decode(selectionSet: Data.self,
from: dataEntry,
variables: variables)
let extensions = body["extensions"] as? JSONObject
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.

This should probably be outside the if let statement since theoretically someone could return stuff in extensions even if data is nil.

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.

Ah. Yeah, I was wondering if I was making the right choice there or not. I'll make an update ASAP. Thank you!

- Moved reference to extensions object into function level scope to be able to assign it to the result even if data doesn't exist in the response.
- Updated tests.
Copy link
Copy Markdown
Contributor

@designatednerd designatednerd left a comment

Choose a reason for hiding this comment

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

🎉 Thanks for the PR!

@designatednerd designatednerd merged commit afa819c into apollographql:main Aug 31, 2020
@designatednerd designatednerd added this to the Next Release milestone Aug 31, 2020
@paulkite paulkite deleted the add-extensions-to-graphqlresult branch October 1, 2020 19:54
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