-
Notifications
You must be signed in to change notification settings - Fork 61
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 Custom Scalar should not be edited.
output
#243
fix Custom Scalar should not be edited.
output
#243
Conversation
@matsudamper: 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/ |
👷 Deploy request for eclectic-pie-88a2ba pending review.Visit the deploys page to approve it
|
should not be edited.
output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this bug fix! This test was missing and made this bug difficult to catch during my refactor.
99aa12d9 fix Custom Scalar output (#243) git-subtree-dir: apollo-ios-codegen git-subtree-split: 99aa12d9c1be923c3c30e8cb54babdf7c574d96b
git-subtree-dir: apollo-ios-codegen git-subtree-mainline: 1ebbe4c git-subtree-split: 99aa12d9c1be923c3c30e8cb54babdf7c574d96b
Do we need to be worried that this was more than just a comment-related bug? I'd be far more concerned if we were actually overwriting pre-existing custom scalar files; do we need an additional test for that? |
No, this wouldn't have affected that. It was just a change in the function signature for the functions: func renderHeaderTemplate(
nonFatalErrorRecorder: ApolloCodegen.NonFatalError.Recorder
) -> TemplateString? {
func renderDetachedTemplate(
nonFatalErrorRecorder: ApolloCodegen.NonFatalError.Recorder
) -> TemplateString? {
nil
}
and
func renderBodyTemplate(
nonFatalErrorRecorder: ApolloCodegen.NonFatalError.Recorder
) -> TemplateString It would not affect the logic for the overwriting. |
Executing the I've had a look through |
Sorry. I had my reply in draft for a while and didn't see your reply before posting it. |
fix: apollographql/apollo-ios#3323
cast to
TemplateRenderer
apollo-ios-dev/apollo-ios-codegen/Sources/ApolloCodegenLib/FileGenerators/CustomScalarFileGenerator.swift
Lines 11 to 13 in cce0d07
Optional is different.
apollo-ios-dev/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/CustomScalarTemplate.swift
Lines 23 to 25 in cce0d07
The implementation of the extension is used.
apollo-ios-dev/apollo-ios-codegen/Sources/ApolloCodegenLib/Templates/TemplateRenderer.swift
Lines 76 to 80 in cce0d07
relevance
#152