Skip to content

Commit cb05c7f

Browse files
Merge pull request #658 from apollographql/add/headers
Send headers if possible
2 parents f2cfca2 + 56319b2 commit cb05c7f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/Apollo/HTTPNetworkTransport.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ public class HTTPNetworkTransport: NetworkTransport {
268268
}
269269
}
270270

271+
request.setValue(operation.operationName, forHTTPHeaderField: "X-APOLLO-OPERATION-NAME")
272+
273+
if let operationID = operation.operationIdentifier {
274+
request.setValue(operationID, forHTTPHeaderField: "X-APOLLO-OPERATION-ID")
275+
}
276+
271277
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
272278

273279
// If there's a delegate, do a pre-flight check and allow modifications to the request.

0 commit comments

Comments
 (0)