Skip to content

Commit 6418e4e

Browse files
committed
Make the introspection type maps alphabetical
1 parent 97f05af commit 6418e4e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/SchemaGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ enum class BuiltinType
2121
ID,
2222
};
2323

24-
using BuiltinTypeMap = std::unordered_map<std::string, BuiltinType>;
24+
using BuiltinTypeMap = std::map<std::string, BuiltinType>;
2525

2626
// These are the C++ types we'll use for them.
2727
using CppTypeMap = std::array<std::string, static_cast<size_t>(BuiltinType::ID) + 1>;
@@ -38,7 +38,7 @@ enum class SchemaType
3838
Operation,
3939
};
4040

41-
using SchemaTypeMap = std::unordered_map<std::string, SchemaType>;
41+
using SchemaTypeMap = std::map<std::string, SchemaType>;
4242

4343
// Keep track of the positions of each type declaration in the file.
4444
using PositionMap = std::unordered_map<std::string, tao::graphqlpeg::position>;

samples/introspection/IntrospectionSchema.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@ std::future<response::Value> Directive::resolve_typename(service::ResolverParams
488488

489489
void AddTypesToSchema(std::shared_ptr<introspection::Schema> schema)
490490
{
491-
schema->AddType("Int", std::make_shared<introspection::ScalarType>("Int", R"md(Built-in type)md"));
491+
schema->AddType("Boolean", std::make_shared<introspection::ScalarType>("Boolean", R"md(Built-in type)md"));
492492
schema->AddType("Float", std::make_shared<introspection::ScalarType>("Float", R"md(Built-in type)md"));
493493
schema->AddType("ID", std::make_shared<introspection::ScalarType>("ID", R"md(Built-in type)md"));
494+
schema->AddType("Int", std::make_shared<introspection::ScalarType>("Int", R"md(Built-in type)md"));
494495
schema->AddType("String", std::make_shared<introspection::ScalarType>("String", R"md(Built-in type)md"));
495-
schema->AddType("Boolean", std::make_shared<introspection::ScalarType>("Boolean", R"md(Built-in type)md"));
496496
auto typeTypeKind = std::make_shared<introspection::EnumType>("__TypeKind", R"md()md");
497497
schema->AddType("__TypeKind", typeTypeKind);
498498
auto typeDirectiveLocation = std::make_shared<introspection::EnumType>("__DirectiveLocation", R"md()md");

0 commit comments

Comments
 (0)