prisma1 icon indicating copy to clipboard operation
prisma1 copied to clipboard

[1.0/RC1] generated file breaking with tick (`) in comment

Open philcockfield opened this issue 8 years ago • 3 comments

Posted in forum here

Version: - graphql-cli@2.10.1

When generated the graphcool.ts during a deploy (via graphql prepare) the file being generated contains:

const typeDefs = `
# THIS FILE HAS BEEN AUTO-GENERATED BY THE "GRAPHCOOL DEPLOY"
# DO NOT EDIT THIS FILE DIRECTLY
...

On line 503 of my generated file, it is inserting some boilerplate documentation for Long which includes ticks, and therefore breaks the containing tick-marks of the template string:

"""
The `Long` scalar type represents non-fractional signed whole numeric values.
Long can represent values between -(2^63) and 2^63 - 1.
"""
scalar Long

This results in graphcool.ts causing typescript build errors, eg:

image

philcockfield avatar Jan 12 '18 06:01 philcockfield

Solution?

Escape tick marks in all boilerplate documentation before writing into the file?

"""
The \`Long\` scalar type represents non-fractional signed whole numeric values.
Long can represent values between -(2^63) and 2^63 - 1.
"""

philcockfield avatar Jan 12 '18 06:01 philcockfield

@marktani @philcockfield This has been solved in https://github.com/supergraphql/graphql-static-binding/pull/51

gjungb avatar Feb 15 '18 14:02 gjungb

Thanks for the heads up @gjungb 🙏

marktani avatar Feb 16 '18 18:02 marktani