Skip to content

Commit

Permalink
fiks queryName logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kenglxn committed Dec 20, 2024
1 parent 44369b3 commit b40cbbd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ data class GraphQLRequest(
val operationName: String? = null,
val variables: Map<String, Any?>? = null,
) {
val queryNameRegex = Regex("\\b(mutation|query).*\\{\\s*(\\w+)")
val queryNameRegex = Regex("\\b(mutation|query).*?\\{\\s*(\\w+)")
val queryName: String
get() {
return queryNameRegex.find(query)?.groups?.get(2)?.value ?: "unknown"
Expand Down

0 comments on commit b40cbbd

Please sign in to comment.