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

fix: Updating test mock set method definitions #3089

Merged
merged 4 commits into from
Jun 23, 2023

Conversation

BobaFetters
Copy link
Member

@BobaFetters BobaFetters commented Jun 22, 2023

-Updated the definitions of the test mock _set method definitions
-Updated MockObjectTemplate to generate mocks with new definitions

Closes #3023
Closes #3043

-Updated the definitions of the test mock _set method definitions
-Updated MockObjectTemplate to generate mocks with new definitions
@netlify
Copy link

netlify bot commented Jun 22, 2023

Deploy Preview for apollo-ios-docs canceled.

Name Link
🔨 Latest commit 353267a
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docs/deploys/6495f9740bbea400087b0a0c

@BobaFetters BobaFetters requested a review from AnthonyMDev June 22, 2023 20:38
}
}
""") : TemplateString(stringLiteral: "")
)

"""
}

private func getMockSetType(_ graphQLType: GraphQLType) -> String {
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I like the name of this function, open to other suggestions here.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe just remove the get - mockSetType or something completely different in mockFunctionDescriptor.

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.

I think this is the right approach. Didn't look like we were going to get it right through typing alone.

}
}
""") : TemplateString(stringLiteral: "")
)

"""
}

private func getMockSetType(_ graphQLType: GraphQLType) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just remove the get - mockSetType or something completely different in mockFunctionDescriptor.

@BobaFetters BobaFetters marked this pull request as ready for review June 23, 2023 19:15
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.

Looks good, just one question on the changes to AnimalKingdomAPI.

Copy link
Contributor

@AnthonyMDev AnthonyMDev left a comment

Choose a reason for hiding this comment

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

Two minor suggestions, but this looks great! Thanks so much @BobaFetters

case .entity(_):
return "Entity"
case .inputObject(_):
preconditionFailure()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: might want to also add a message to this failure to help us identify the issue if a user ever encounters this and files a bug report.

@BobaFetters BobaFetters merged commit 03baa31 into main Jun 23, 2023
@BobaFetters BobaFetters deleted the fix/test-mock-set-methods branch June 23, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants