You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: servers/graphql-kotlin-ktor-server/src/main/kotlin/com/expediagroup/graphql/server/ktor/KtorGraphQLRequestParser.kt
val query = request.queryParameters[REQUEST_PARAM_QUERY] ?:throwIllegalStateException("Invalid HTTP request - GET request has to specify query parameter")
Copy file name to clipboardExpand all lines: servers/graphql-kotlin-ktor-server/src/test/kotlin/com/expediagroup/graphql/server/ktor/GraphQLPluginTest.kt
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -125,10 +125,11 @@ class GraphQLPluginTest {
125
125
}
126
126
127
127
@Test
128
-
fun`server should return Method Not Allowed for Mutation GET requests`() {
128
+
fun`server should return Method Not Allowed for Mutation GET requests persisted query`() {
Copy file name to clipboardExpand all lines: servers/graphql-kotlin-ktor-server/src/test/kotlin/com/expediagroup/graphql/server/ktor/KtorGraphQLRequestParserTest.kt
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ class KtorGraphQLRequestParserTest {
35
35
fun`parseRequest should throw IllegalStateException if request method is GET without query`() = runTest {
36
36
val request = mockk<ApplicationRequest>(relaxed =true) {
37
37
every { queryParameters[REQUEST_PARAM_QUERY] } returns null
38
+
every { queryParameters[REQUEST_PARAM_EXTENSIONS] } returns null
38
39
every { local.method } returns HttpMethod.Get
39
40
}
40
41
assertFailsWith<IllegalStateException> {
@@ -60,6 +61,7 @@ class KtorGraphQLRequestParserTest {
60
61
every { queryParameters[REQUEST_PARAM_QUERY] } returns "{ foo }"
61
62
every { queryParameters[REQUEST_PARAM_OPERATION_NAME] } returns null
62
63
every { queryParameters[REQUEST_PARAM_VARIABLES] } returns null
64
+
every { queryParameters[REQUEST_PARAM_EXTENSIONS] } returns null
63
65
every { local.method } returns HttpMethod.Get
64
66
}
65
67
val graphQLRequest = parser.parseRequest(serverRequest)
@@ -76,6 +78,7 @@ class KtorGraphQLRequestParserTest {
76
78
every { queryParameters[REQUEST_PARAM_QUERY] } returns "query MyFoo { foo }"
77
79
every { queryParameters[REQUEST_PARAM_OPERATION_NAME] } returns "MyFoo"
78
80
every { queryParameters[REQUEST_PARAM_VARIABLES] } returns """{"a":1}"""
81
+
every { queryParameters[REQUEST_PARAM_EXTENSIONS] } returns null
79
82
every { local.method } returns HttpMethod.Get
80
83
}
81
84
val graphQLRequest = parser.parseRequest(serverRequest)
@@ -86,6 +89,27 @@ class KtorGraphQLRequestParserTest {
Copy file name to clipboardExpand all lines: servers/graphql-kotlin-spring-server/src/main/kotlin/com/expediagroup/graphql/server/spring/execution/SpringGraphQLRequestParser.kt
Copy file name to clipboardExpand all lines: servers/graphql-kotlin-spring-server/src/test/kotlin/com/expediagroup/graphql/server/spring/execution/SpringGraphQLRequestParserTest.kt
0 commit comments