Skip to content

Commit

Permalink
Added content-type for GQL
Browse files Browse the repository at this point in the history
Set Content-Type to application/graphql for GQL queries and mutations
  • Loading branch information
ecrichlow committed Sep 15, 2022
1 parent fb6b938 commit f79df5b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IoGInfrastructure.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@
OBJ_28 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 13;
DRIVERKIT_DEPLOYMENT_TARGET = 19.0;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -444,7 +444,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 3.5;
MARKETING_VERSION = 3.6;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand All @@ -463,7 +463,7 @@
OBJ_29 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 13;
DRIVERKIT_DEPLOYMENT_TARGET = 19.0;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -475,7 +475,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 3.5;
MARKETING_VERSION = 3.6;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down
16 changes: 16 additions & 0 deletions Source/IoGInfrastructure/Managers/GraphQL/IoGGQLManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlQuery.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfDefaultType().registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfDefaultType().transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand Down Expand Up @@ -229,6 +231,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlQuery.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfDefaultType().registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfDefaultType().transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand All @@ -249,6 +253,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlQuery.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand All @@ -269,6 +275,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlQuery.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand Down Expand Up @@ -300,6 +308,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlMutation.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfDefaultType().registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfDefaultType().transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand Down Expand Up @@ -339,6 +349,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlMutation.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfDefaultType().registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfDefaultType().transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand Down Expand Up @@ -367,6 +379,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlMutation.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand Down Expand Up @@ -395,6 +409,8 @@ public class IoGGQLManager: IoGDataManagerDelegate
let payloadData = Data(gqlMutation.utf8)
urlRequest.httpBody = payloadData
urlRequest.httpMethod = "POST"
urlRequest.setValue("application/json", forHTTPHeaderField: "Accept")
urlRequest.setValue("application/graphql", forHTTPHeaderField: "Content-Type")
IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).registerDelegate(delegate: self)
let dataManagerRequestID = IoGDataManager.dataManagerOfType(type: .IoGDataManagerTypeMock).transmitRequest(request: urlRequest, customTypeIdentifier: IoGConfigurationManager.gqlManagerCustomDataManagerType)
requestID += 1
Expand Down

0 comments on commit f79df5b

Please sign in to comment.