Skip to content

Commit df763b0

Browse files
committed
Update sample and remove duplicate types from Schema constructor
1 parent 44fd291 commit df763b0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Introspection.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ namespace introspection {
99

1010
Schema::Schema()
1111
{
12-
AddType("Int", std::make_shared<ScalarType>("Int", ""));
13-
AddType("Float", std::make_shared<ScalarType>("Float", ""));
14-
AddType("String", std::make_shared<ScalarType>("String", ""));
15-
AddType("Boolean", std::make_shared<ScalarType>("Boolean", ""));
16-
AddType("ID", std::make_shared<ScalarType>("ID", ""));
1712
}
1813

1914
void Schema::AddQueryType(std::shared_ptr<ObjectType> query)

samples/IntrospectionSchema.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,11 @@ std::future<response::Value> __Directive::resolve__typename(service::ResolverPar
536536

537537
void AddTypesToSchema(std::shared_ptr<introspection::Schema> schema)
538538
{
539+
schema->AddType("Int", std::make_shared<introspection::ScalarType>("Int", R"md(Built-in type)md"));
540+
schema->AddType("Float", std::make_shared<introspection::ScalarType>("Float", R"md(Built-in type)md"));
541+
schema->AddType("ID", std::make_shared<introspection::ScalarType>("ID", R"md(Built-in type)md"));
542+
schema->AddType("String", std::make_shared<introspection::ScalarType>("String", R"md(Built-in type)md"));
543+
schema->AddType("Boolean", std::make_shared<introspection::ScalarType>("Boolean", R"md(Built-in type)md"));
539544
auto type__TypeKind= std::make_shared<introspection::EnumType>("__TypeKind", R"md()md");
540545
schema->AddType("__TypeKind", type__TypeKind);
541546
auto type__DirectiveLocation= std::make_shared<introspection::EnumType>("__DirectiveLocation", R"md()md");

0 commit comments

Comments
 (0)