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

Fixed available tag in generator #163

Closed
wants to merge 1 commit into from
Closed

Conversation

arguiot
Copy link

@arguiot arguiot commented Oct 1, 2023

I fixed an issue where the generator would write an available string that could potentially include multi-line statements.

@vercel
Copy link

vercel bot commented Oct 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
swift-graphql ❌ Failed (Inspect) Oct 1, 2023 1:57am

@@ -91,7 +91,9 @@ extension Field {
if isDeprecated {
// NOTE: It's possible that a string contains double-quoted characters in deprecation reason.
// http://spec.graphql.org/October2021/#sec-Language.Directives
let message = deprecationReason?.replacingOccurrences(of: "\"", with: "\\\"") ?? ""
let message = deprecationReason?
.trimmingCharacters(in: .whitespacesAndNewlines)
Copy link
Collaborator

@shaps80 shaps80 Oct 12, 2023

Choose a reason for hiding this comment

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

The Swift version also can support multiple line messages, which can improve readability so I'd suggest we retain that?

@available(*, deprecated, message: """
Line 1
Line 2
""")

Could we just check for a newline character, and if it exists, we use this alternative multi-line string instead to ensure we retain the documentation as it was intended?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, let's do that!

@shaps80
Copy link
Collaborator

shaps80 commented Oct 18, 2023

#169 provides a multiline solution that will automatically close this PR once its merged 👍

@shaps80 shaps80 closed this in #169 Oct 19, 2023
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.

None yet

3 participants