Skip to content

Commit

Permalink
the bad resolution of the filename caused queries to be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
terhechte committed Dec 14, 2022
1 parent 66a2e3d commit c8a339b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/SwiftGraphQL/HTTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ private func createGraphQLRequest<Type, TypeLock>(
#if DEBUG
#if targetEnvironment(simulator)
// Write the query
let filename = operationName ?? "\(Int(Date().timeIntervalSince1970))"
let time = DispatchTime.now().uptimeNanoseconds()
let filename = operationName ?? "\(time))"
try? payload.query.write(toFile: "/tmp/query_\(filename).graphql", atomically: true, encoding: .utf8)
// Write the variables
if let variables = try? encoder.encode(payload.variables) {
Expand Down

0 comments on commit c8a339b

Please sign in to comment.