From 5f97d3316d3611facb74197c8c8e221fe0782c83 Mon Sep 17 00:00:00 2001 From: Jairus Date: Mon, 4 Nov 2024 16:29:17 -0500 Subject: [PATCH] use proper GraphQL doc comments --- runtime/graphql/schemagen/schemagen.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/graphql/schemagen/schemagen.go b/runtime/graphql/schemagen/schemagen.go index 1412068b..b6acb6e7 100644 --- a/runtime/graphql/schemagen/schemagen.go +++ b/runtime/graphql/schemagen/schemagen.go @@ -339,9 +339,9 @@ func writeSchema(buf *bytes.Buffer, queryFields []*FieldDefinition, mutationFiel for _, t := range inputTypeDefs { buf.WriteByte('\n') if t.Docs != nil { - for _, l := range strings.Split(t.Docs.Description, "\n") { - buf.WriteString("# " + l + "\n") - } + buf.WriteString("\"\"\"\n") + buf.WriteString(t.Docs.Description) + buf.WriteString("\"\"\"\n") } buf.WriteString("input ") buf.WriteString(t.Name) @@ -376,9 +376,9 @@ func writeSchema(buf *bytes.Buffer, queryFields []*FieldDefinition, mutationFiel func writeField(buf *bytes.Buffer, field *FieldDefinition) { buf.WriteString(" ") if field.Docs != nil { - for _, l := range strings.Split(field.Docs.Description, "\n") { - buf.WriteString("# " + l + "\n") - } + buf.WriteString("\"\"\"\n") + buf.WriteString(field.Docs.Description) + buf.WriteString("\"\"\"\n") buf.WriteString(" ") } buf.WriteString(field.Name)