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

JSONConverter helper #380

Merged
merged 3 commits into from
Jun 7, 2024
Merged

JSONConverter helper #380

merged 3 commits into from
Jun 7, 2024

Conversation

AnthonyMDev
Copy link
Contributor

This is an alternative API for the changes in #377. It also cleans up the unit tests so we don't need to import StarWarsAPI in more places (hoping we can get rid of it completely eventually).

@TizianoCoroneo @calvincestari @BobaFetters I think this is an improvement on the API in the other PR. Let me know what you think.

Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for apollo-ios-docc ready!

Name Link
🔨 Latest commit 4a743b3
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docc/deploys/6661ff5537cc460008f9422b
😎 Deploy Preview https://deploy-preview-380--apollo-ios-docc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for eclectic-pie-88a2ba canceled.

Name Link
🔨 Latest commit 4a743b3
🔍 Latest deploy log https://app.netlify.com/sites/eclectic-pie-88a2ba/deploys/6661ff5573f8ab0008001dfb

/// Converts a ``SelectionSet`` into a basic JSON dictionary for use.
///
/// - Returns: A `[String: Any]` JSON dictionary representing the ``SelectionSet``.
public static func convert(_ selectionSet: some SelectionSet) -> [String: Any] {
Copy link
Contributor

Choose a reason for hiding this comment

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

as you might have guessed from my PR, I'm not a fan of relying on the compiler to select the right overload, but that's my personal preference. The changes in this PR still work fine for my use case. Thanks for the help!

Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

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

LGTM! Do we have a test for the GraphQLError conversion anywhere already?

@AnthonyMDev AnthonyMDev force-pushed the data-dict-as-json-dictionary branch from 79a3e17 to 4a743b3 Compare June 6, 2024 18:26
@AnthonyMDev
Copy link
Contributor Author

LGTM! Do we have a test for the GraphQLError conversion anywhere already?

Yes, it's at GraphQLResultTests.swift:69

@AnthonyMDev AnthonyMDev merged commit f039f52 into main Jun 7, 2024
24 of 25 checks passed
@AnthonyMDev AnthonyMDev deleted the data-dict-as-json-dictionary branch June 7, 2024 19:34
BobaFetters pushed a commit that referenced this pull request Jun 7, 2024
BobaFetters pushed a commit to apollographql/apollo-ios that referenced this pull request Jun 7, 2024
BobaFetters pushed a commit that referenced this pull request Jun 7, 2024
b52a8610 JSONConverter helper (#380)

git-subtree-dir: apollo-ios
git-subtree-split: b52a86100fd041481a9f191f4a1ab007069a41a1
BobaFetters pushed a commit that referenced this pull request Jun 7, 2024
git-subtree-dir: apollo-ios
git-subtree-mainline: 4ef0f28
git-subtree-split: b52a86100fd041481a9f191f4a1ab007069a41a1
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