Skip to content

Commit 0d42efd

Browse files
committed
WIP input type cycle detection
1 parent e0474e4 commit 0d42efd

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

include/SchemaLoader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct InputType
106106
InputFieldList fields;
107107
std::string_view description;
108108
std::unordered_set<std::string_view> dependencies {};
109+
std::vector<std::string_view> forwardDeclarations {};
109110
};
110111

111112
using InputTypeList = std::vector<InputType>;

samples/today/schema.today.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,11 @@ input ThirdNestedInput {
184184
input FourthNestedInput {
185185
id: ID!
186186
}
187+
188+
#input IncludeNullableSelfInput {
189+
# self: IncludeNullableSelfInput
190+
#}
191+
#
192+
#input IncludeNonNullableListSelfInput {
193+
# selves: [IncludeNonNullableListSelfInput!]!
194+
#}

src/SchemaLoader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ void SchemaLoader::reorderInputTypeDependencies()
388388
});
389389
});
390390

391+
std::unordered_set<std::string_view> forwardDeclared;
391392
std::unordered_set<std::string_view> handled;
392393
auto itr = _inputTypes.begin();
393394

0 commit comments

Comments
 (0)