Skip to content

Commit

Permalink
Fix printing description on schema (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r authored Apr 20, 2023
1 parent 0e0a871 commit f1cb807
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>8.0.0-preview</VersionPrefix>
<VersionPrefix>9.0.1-preview</VersionPrefix>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);CA1707</NoWarn>
Expand Down
13 changes: 13 additions & 0 deletions src/GraphQLParser.Tests/Visitors/SDLPrinterFromParsedTextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,19 @@ query q(
$a: Int) {
x
}
""")]
[InlineData(49,
"""
"description"
schema {
query: Query
}
""",
"""
"description"
schema {
query: Query
}
""")]
public async Task SDLPrinter_Should_Print_Document(
int number,
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQLParser/Visitors/SDLPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ protected override async ValueTask VisitSchemaDefinitionAsync(GraphQLSchemaDefin
{
await VisitAsync(schemaDefinition.Comments, context).ConfigureAwait(false);
await VisitAsync(schemaDefinition.Description, context).ConfigureAwait(false);
await context.WriteAsync("schema").ConfigureAwait(false);
await VisitAsync(LiteralNode.Wrap("schema"), context).ConfigureAwait(false);
await VisitAsync(schemaDefinition.Directives, context).ConfigureAwait(false);

//bool freshLine = schemaDefinition.Comments != null && Options.PrintComments; always false
Expand Down

0 comments on commit f1cb807

Please sign in to comment.