Skip to content

Commit 448d491

Browse files
committed
Remove graphqlparser dependency
1 parent 6ceea9c commit 448d491

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ endif()
1212
add_library(graphqlservice GraphQLService.cpp Introspection.cpp IntrospectionSchema.cpp)
1313
add_executable(schemagen SchemaGenerator.cpp)
1414

15-
find_library(GRAPHQLPARSER graphqlparser)
16-
1715
find_package(cpprestsdk REQUIRED)
1816
set(CPPRESTSDK cpprestsdk::cpprest)
1917

@@ -26,11 +24,11 @@ find_package(pegtl CONFIG REQUIRED)
2624

2725
add_library(graphqlpeg GraphQLGrammar.cpp)
2826
target_include_directories(graphqlpeg INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}> $<INSTALL_INTERFACE:include>)
29-
target_link_libraries(graphqlpeg taocpp::pegtl ${GRAPHQLPARSER})
27+
target_link_libraries(graphqlpeg taocpp::pegtl)
3028

3129
target_include_directories(graphqlservice INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}> $<INSTALL_INTERFACE:include>)
32-
target_link_libraries(graphqlservice ${CPPRESTSDK} ${GRAPHQLPARSER} graphqlpeg)
33-
target_link_libraries(schemagen ${CPPRESTSDK} ${GRAPHQLPARSER} graphqlpeg)
30+
target_link_libraries(graphqlservice ${CPPRESTSDK} graphqlpeg)
31+
target_link_libraries(schemagen ${CPPRESTSDK} graphqlpeg)
3432

3533
add_custom_command(
3634
OUTPUT IntrospectionSchema.cpp IntrospectionSchema.h
@@ -63,15 +61,13 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
6361

6462
target_link_libraries(todaygraphql
6563
${CPPRESTSDK}
66-
${GRAPHQLPARSER}
6764
graphqlservice)
6865
target_include_directories(todaygraphql SYSTEM PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
6966

7067
add_executable(test_today test_today.cpp)
7168

7269
target_link_libraries(test_today
7370
${CPPRESTSDK}
74-
${GRAPHQLPARSER}
7571
graphqlpeg
7672
graphqlservice
7773
todaygraphql)
@@ -82,7 +78,6 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
8278
find_package(GTest REQUIRED)
8379
target_link_libraries(tests
8480
${CPPRESTSDK}
85-
${GRAPHQLPARSER}
8681
graphqlpeg
8782
graphqlservice
8883
todaygraphql

tests.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ TEST_F(TodayServiceCase, QueryEverything)
103103
}
104104
})gql");
105105
auto result = _service->resolve(*ast, "Everything", web::json::value::object().as_object());
106-
EXPECT_EQ(1, _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
107-
EXPECT_EQ(1, _getTasksCount) << "today service lazy loads the tasks and caches the result";
108-
EXPECT_EQ(1, _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
106+
EXPECT_EQ(size_t(1), _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
107+
EXPECT_EQ(size_t(1), _getTasksCount) << "today service lazy loads the tasks and caches the result";
108+
EXPECT_EQ(size_t(1), _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
109109

110110
try
111111
{
@@ -175,9 +175,9 @@ TEST_F(TodayServiceCase, QueryAppointments)
175175
}
176176
})gql");
177177
auto result = _service->resolve(*ast, "", web::json::value::object().as_object());
178-
EXPECT_EQ(1, _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
179-
EXPECT_GE(1, _getTasksCount) << "today service lazy loads the tasks and caches the result";
180-
EXPECT_GE(1, _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
178+
EXPECT_EQ(size_t(1), _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
179+
EXPECT_GE(size_t(1), _getTasksCount) << "today service lazy loads the tasks and caches the result";
180+
EXPECT_GE(size_t(1), _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
181181

182182
try
183183
{
@@ -226,9 +226,9 @@ TEST_F(TodayServiceCase, QueryTasks)
226226
}
227227
})gql");
228228
auto result = _service->resolve(*ast, "", web::json::value::object().as_object());
229-
EXPECT_GE(1, _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
230-
EXPECT_EQ(1, _getTasksCount) << "today service lazy loads the tasks and caches the result";
231-
EXPECT_GE(1, _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
229+
EXPECT_GE(size_t(1), _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
230+
EXPECT_EQ(size_t(1), _getTasksCount) << "today service lazy loads the tasks and caches the result";
231+
EXPECT_GE(size_t(1), _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
232232

233233
try
234234
{
@@ -276,9 +276,9 @@ TEST_F(TodayServiceCase, QueryUnreadCounts)
276276
}
277277
})gql");
278278
auto result = _service->resolve(*ast, "", web::json::value::object().as_object());
279-
EXPECT_GE(1, _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
280-
EXPECT_GE(1, _getTasksCount) << "today service lazy loads the tasks and caches the result";
281-
EXPECT_EQ(1, _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
279+
EXPECT_GE(size_t(1), _getAppointmentsCount) << "today service lazy loads the appointments and caches the result";
280+
EXPECT_GE(size_t(1), _getTasksCount) << "today service lazy loads the tasks and caches the result";
281+
EXPECT_EQ(size_t(1), _getUnreadCountsCount) << "today service lazy loads the unreadCounts and caches the result";
282282

283283
try
284284
{

0 commit comments

Comments
 (0)