Summarizing, there is a enum which is a input type called DocumentType and its facing conflict with newest Apollo 1.0 because now there is a defined structure called DocumentType as well.
// This file was automatically generated and should not be edited.
import Apollo
public enum DocumentType: String, EnumType {
case unspecifiedDocumentType = "UNSPECIFIED_DOCUMENT_TYPE"
case selfie = "SELFIE"
/* ... more cases */
}
The autogenerated schema:
// This file was automatically generated and should not be edited.
@_exported import Apollo
public class CustomMutationOperation: GraphQLMutation {
public static let operationName: String = "operationName"
public static let document: DocumentType = .notPersisted(
definition: .init(
"""
// the document description
"""
))
Error: Type 'DocumentType' has no member 'notPersisted'
There is anything that can be done to solve this conflict?
Hi @celtaheaven - there was a fix in 1.0.2 specifically for this type of bug - release notes. Please make sure you’re using the latest version available.
I have a similar conflict but with Selection type. Is there any way to just make codegen always prefix with Apollo. so that these conflicts don’t happen?
Hi @tahirmt - unfortunately no way to prefix type names but Anthony and I have discussed the issue and will see what can be done to resolve this and some other type name conflicts we’ve seen lately.