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

Access Level Update for AbstractResponse.rawFields property #1192

Closed
mahmutpinarbasi opened this issue Jan 30, 2023 · 5 comments · Fixed by #1194
Closed

Access Level Update for AbstractResponse.rawFields property #1192

mahmutpinarbasi opened this issue Jan 30, 2023 · 5 comments · Fixed by #1194

Comments

@mahmutpinarbasi
Copy link

Hi,

With latest 10.0.0 [2023-01] release, rawFields ( previously fields) property access level changed to internal on AbstractResponse class. which is kind a breaking change for entire serialize/deserialize operation on our app. So wondering was it intentional? Is it possible to switch back to public access level again?

You can also see the similar usage on mobile-buy-sdk-ios-sample

Screen Shot 2023-01-31 at 01 04 05

If you guys ok with it; I can create the PR. what do you think @cocoahero ?

@cocoahero
Copy link
Contributor

Hi @mahmutpinarbasi - yes this was intentional as the previous property name was conflicting with a newly added schema field. We made it internal so that it would be easier to fix in the future if this were to happen again.

Curious how you are using this property? What serialization/deserialization are you having to do that the built in model objects do not provide?

@mahmutpinarbasi
Copy link
Author

Hi @cocoahero,

My usage is as following;

extension GraphQL.AbstractResponse: Serializable {
    
    static func deserialize(from representation: SerializedRepresentation) -> Self? {
        return try? self.init(fields: representation)
    }
    
    func serialize() -> SerializedRepresentation {
        return self.fields
    }
}

We are using similar infrastructure on our app with buy sdk example app. You can get more details about the usage from here: https://github.com/Shopify/mobile-buy-sdk-ios-sample/blob/0565810b86227df0a0211d38490718e1f9f5eb7b/Storefront/GraphQL%2BSerializable.swift

@cocoahero
Copy link
Contributor

Hi @mahmutpinarbasi - please see the above linked PR and let me know if that will solve for your use case.

@mahmutpinarbasi
Copy link
Author

Hi @cocoahero,

It perfectly solves the issue. Thanks for the quick action.

@cocoahero
Copy link
Contributor

cocoahero commented Feb 1, 2023

The PR has been shipped and v10.1 has been tagged and released. I will work on updating the sample code to reflect the changes. Thanks for letting us know.

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 a pull request may close this issue.

2 participants