Skip to content

Internalize [2 of 4] #18

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

Closed
wants to merge 1 commit into from
Closed

Internalize [2 of 4] #18

wants to merge 1 commit into from

Conversation

dbart01
Copy link
Contributor

@dbart01 dbart01 commented Sep 11, 2017

What this does

Coverts unnecessarily public methods to internal.

Relies on #13

Copy link
Contributor

@BenEmdon BenEmdon left a comment

Choose a reason for hiding this comment

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

Merge when 🍏

@BenEmdon
Copy link
Contributor

BenEmdon commented Sep 12, 2017

Build failures look legit 😕

@dbart01 dbart01 changed the base branch from task/revert-explicit-null to master September 12, 2017 13:49
public let data: DataType?
public let errors: [GraphQL.ResponseError]?
internal let data: DataType?
internal let errors: [GraphQL.ResponseError]?
Copy link

Choose a reason for hiding this comment

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

these should be left public, they are the purpose of this struct (deserializing response into errors/data)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They aren't needed on any of the generated models.

Copy link

@g-Off g-Off Sep 12, 2017

Choose a reason for hiding this comment

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

They are/can be used by external code though. From the README

guard let response = try? GraphQLResponse<ExampleSchema.QueryRoot>(jsonData: response) else {
    print("Invalid GraphQL response")
    return
}
if let errors = response.errors {
    for error in errors {
        print("GraphQL error: \(error.message)")
    }
}
if let data = response.data {
    let user = data.user
    print("\(user.firstName) \(user.lastName)")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is GraphQLResponse used for? I can't find any usage of it. Can we not just remove it entirely?

@dbart01 dbart01 closed this Sep 12, 2017
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