@@ -155,7 +155,29 @@ std::future<response::Value> Query::resolveUnreadCounts(service::ResolverParams&
155155
156156std::future<response::Value> Query::resolveAppointmentsById (service::ResolverParams&& params)
157157{
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));
159181 auto result = getAppointmentsById (service::FieldParams (params, std::move (params.fieldDirectives )), std::move (argIds));
160182
161183 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)
811833 std::make_shared<introspection::InputValue>(" before" , R"md( )md" , schema->LookupType (" ItemCursor" ), R"gql( )gql" )
812834 }), schema->WrapType (introspection::__TypeKind::NON_NULL, schema->LookupType (" FolderConnection" ))),
813835 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" )
815837 }), schema->WrapType (introspection::__TypeKind::NON_NULL, schema->WrapType (introspection::__TypeKind::LIST, schema->LookupType (" Appointment" )))),
816838 std::make_shared<introspection::Field>(" tasksById" , R"md( )md" , std::unique_ptr<std::string>(nullptr ), std::vector<std::shared_ptr<introspection::InputValue>>({
817839 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