Skip to content

Commit

Permalink
Adding name spacing to ApolloAPI.Object (apollographql/apollo-ios-dev#94
Browse files Browse the repository at this point in the history
)
  • Loading branch information
BobaFetters authored and runner committed Oct 23, 2023
1 parent f2bbc9a commit 6a23fed
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct MockObjectTemplate: TemplateRenderer {

return """
\(accessControlModifier(for: .parent))class \(objectName): MockObject {
\(memberAccessControl)static let objectType: Object = \(config.schemaNamespace.firstUppercased).Objects.\(objectName)
\(memberAccessControl)static let objectType: \(config.ApolloAPITargetName).Object = \(config.schemaNamespace.firstUppercased).Objects.\(objectName)
\(memberAccessControl)static let _mockFields = MockFields()
\(memberAccessControl)typealias MockValueCollectionType = Array<Mock<\(objectName)>>
Expand Down
2 changes: 1 addition & 1 deletion Sources/ApolloCodegenLib/Templates/ObjectTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct ObjectTemplate: TemplateRenderer {
var template: TemplateString {
"""
\(documentation: graphqlObject.documentation, config: config)
static let \(graphqlObject.formattedName) = Object(
static let \(graphqlObject.formattedName) = \(config.ApolloAPITargetName).Object(
typename: "\(graphqlObject.name)\",
implementedInterfaces: \(ImplementedInterfacesTemplate())
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct SchemaConfigurationTemplate: TemplateRenderer {
\(accessControlModifier(for: .parent))enum SchemaConfiguration: \
\(config.ApolloAPITargetName).SchemaConfiguration {
\(accessControlModifier(for: .member))\
static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? {
static func cacheKeyInfo(for type: \(config.ApolloAPITargetName).Object, object: ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct SchemaMetadataTemplate: TemplateRenderer {
var objectTypeFunction: TemplateString {
return """
\(accessControlModifier(for: .member))\
static func objectType(forTypename typename: String) -> Object? {
static func objectType(forTypename typename: String) -> \(config.ApolloAPITargetName).Object? {
switch typename {
\(schema.referencedTypes.objects.map {
"case \"\($0.name)\": return \(schemaNamespace).Objects.\($0.formattedName)"
Expand Down

0 comments on commit 6a23fed

Please sign in to comment.