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

Respect UseXmlDocumentation with Schema.Create #897

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Core/Types.Tests/Types/ObjectTypeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,21 @@ public void CreateObjectTypeWithXmlDocumentation_IgnoreXmlDocs()
schema.ToString().MatchSnapshot();
}

[Fact]
public void CreateObjectTypeWithXmlDocumentation_IgnoreXmlDocs_SchemaCreate()
{
// arrange
// act
ISchema schema = Schema.Create(c =>
{
c.RegisterQueryType<QueryWithDocumentation>();
c.Options.UseXmlDocumentation = false;
});

// assert
schema.ToString().MatchSnapshot();
}

[Fact]
public void Field_Is_Missing_Type_Throws_SchemaException()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
schema {
query: QueryWithDocumentation
}

type QueryWithDocumentation {
foo(bar: String): String
}

"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text."
scalar String
3 changes: 2 additions & 1 deletion src/Core/Types/Configuration/SchemaOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public static SchemaOptions FromOptions(IReadOnlySchemaOptions options)
QueryTypeName = options.QueryTypeName,
MutationTypeName = options.MutationTypeName,
SubscriptionTypeName = options.SubscriptionTypeName,
StrictValidation = options.StrictValidation
StrictValidation = options.StrictValidation,
UseXmlDocumentation = options.UseXmlDocumentation
};
}
}
Expand Down