GraphQL - add support for standard scalar types in the schema (#1011)

* GraphQL: register BuiltInTypes

* GraphQLMatcher_For_ValidSchema_And_CorrectGraphQL_Mutation_IsMatch
This commit is contained in:
Stef Heyenrath
2023-10-16 16:13:53 +02:00
committed by GitHub
parent 62fa4666b5
commit f7cd4b100e
2 changed files with 38 additions and 10 deletions

View File

@@ -137,9 +137,14 @@ public class GraphQLMatcher : IStringMatcher
}
}
private static ISchema BuildSchema(string schema)
private static ISchema BuildSchema(string typeDefinitions)
{
return Schema.For(schema);
var schema = Schema.For(typeDefinitions);
// #984
schema.RegisterTypes(schema.BuiltInTypeMappings.Select(x => x.graphType).ToArray());
return schema;
}
}
#endif