diff --git a/graphql.go b/graphql.go index f064dce..86c1fc6 100644 --- a/graphql.go +++ b/graphql.go @@ -401,7 +401,10 @@ func parseGraphQLQuery(c *fiber.Ctx) *parseGraphQLQueryResult { cfg.Monitoring.IncrementFloat(libpack_monitoring.MetricsGraphQLParsingTime, nil, parseTime) } - return res + // Create a copy to return, since the original will be returned to the pool + // This prevents race conditions where concurrent requests could modify the same result + result := *res + return &result } // processDirectives extracts caching directives from the operation