@@ -155,7 +155,29 @@ std::future<response::Value> Query::resolveUnreadCounts(service::ResolverParams&
155
155
156
156
std::future<response::Value> Query::resolveAppointmentsById (service::ResolverParams&& params)
157
157
{
158
- auto argIds = service::ModifiedArgument<std::vector<uint8_t >>::require<service::TypeModifier::List>(" ids" , params.arguments );
158
+ const auto defaultArguments = []()
159
+ {
160
+ response::Value values (response::Type::Map);
161
+ response::Value entry;
162
+
163
+ entry = []()
164
+ {
165
+ response::Value elements (response::Type::List);
166
+ response::Value entry;
167
+
168
+ entry = response::Value (R"gql( ZmFrZUFwcG9pbnRtZW50SWQ=)gql" );
169
+ elements.emplace_back (std::move (entry));
170
+ return elements;
171
+ }();
172
+ values.emplace_back (" ids" , std::move (entry));
173
+
174
+ return values;
175
+ }();
176
+
177
+ auto pairIds = service::ModifiedArgument<std::vector<uint8_t >>::find<service::TypeModifier::List>(" ids" , params.arguments );
178
+ auto argIds = (pairIds.second
179
+ ? std::move (pairIds.first )
180
+ : service::ModifiedArgument<std::vector<uint8_t >>::require<service::TypeModifier::List>(" ids" , defaultArguments));
159
181
auto result = getAppointmentsById (service::FieldParams (params, std::move (params.fieldDirectives )), std::move (argIds));
160
182
161
183
return service::ModifiedResult<Appointment>::convert<service::TypeModifier::List, service::TypeModifier::Nullable>(std::move (result), std::move (params));
@@ -811,7 +833,7 @@ void AddTypesToSchema(std::shared_ptr<introspection::Schema> schema)
811
833
std::make_shared<introspection::InputValue>(" before" , R"md( )md" , schema->LookupType (" ItemCursor" ), R"gql( )gql" )
812
834
}), schema->WrapType (introspection::__TypeKind::NON_NULL, schema->LookupType (" FolderConnection" ))),
813
835
std::make_shared<introspection::Field>(" appointmentsById" , R"md( )md" , std::unique_ptr<std::string>(nullptr ), std::vector<std::shared_ptr<introspection::InputValue>>({
814
- std::make_shared<introspection::InputValue>(" ids" , R"md( )md" , schema->WrapType (introspection::__TypeKind::NON_NULL, schema->WrapType (introspection::__TypeKind::LIST, schema->WrapType (introspection::__TypeKind::NON_NULL, schema->LookupType (" ID" )))), R"gql( )gql" )
836
+ std::make_shared<introspection::InputValue>(" ids" , R"md( )md" , schema->WrapType (introspection::__TypeKind::NON_NULL, schema->WrapType (introspection::__TypeKind::LIST, schema->WrapType (introspection::__TypeKind::NON_NULL, schema->LookupType (" ID" )))), R"gql( ["ZmFrZUFwcG9pbnRtZW50SWQ="] )gql" )
815
837
}), schema->WrapType (introspection::__TypeKind::NON_NULL, schema->WrapType (introspection::__TypeKind::LIST, schema->LookupType (" Appointment" )))),
816
838
std::make_shared<introspection::Field>(" tasksById" , R"md( )md" , std::unique_ptr<std::string>(nullptr ), std::vector<std::shared_ptr<introspection::InputValue>>({
817
839
std::make_shared<introspection::InputValue>(" ids" , R"md( )md" , schema->WrapType (introspection::__TypeKind::NON_NULL, schema->WrapType (introspection::__TypeKind::LIST, schema->WrapType (introspection::__TypeKind::NON_NULL, schema->LookupType (" ID" )))), R"gql( )gql" )
0 commit comments