Skip to content

Commit

Permalink
Fix backtick escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed May 30, 2018
1 parent 94d5c89 commit 47eaff4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion codegen/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ToCamel(s string) string {
}

func rawQuote(s string) string {
return "`" + strings.Replace(s, "'", "`+\"`\"+`", -1) + "`"
return "`" + strings.Replace(s, "`", "`+\"`\"+`", -1) + "`"
}

func dump(val interface{}) string {
Expand Down
12 changes: 6 additions & 6 deletions example/starwars/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ type Query {
date(filter: DateFilter!): Boolean!
viewer: Viewer
}

// this is a comment with a `backtick`

0 comments on commit 47eaff4

Please sign in to comment.