Skip to content

Swift 6's Upcoming Feature InternalImportsByDefault breaks generated schema/operations #3605

@3redrubies

Description

@3redrubies

Question

When building generated GraphQL targets in Swift 6 with InternalImportsByDefault enabled, the generated code imports cause ApolloAPI symbols to be treated as internal.

// Package.swift
.target(
    name: "GraphQLOperations",
    dependencies: [
        .product(name: "ApolloAPI", package: "apollo-ios"),
        "GraphQLSchema"
    ],
    swiftSettings: [
        .enableUpcomingFeature("InternalImportsByDefault") <-- This
    ]
),
.target(
    name: "GraphQLSchema",
    dependencies: [
        .product(name: "ApolloAPI", package: "apollo-ios")
    ],
    swiftSettings: [
        .enableUpcomingFeature("InternalImportsByDefault") <-- This
    ]
)

This forces downstream properties/types to be internal and results in compilation failures like:
Property must be declared internal because its type 'Object' uses an internal type

Is the team planning to support Swift’s InternalImportsByDefault feature (either now or closer to when it (maybe) becomes the default in Swift 7)?

Just wondering if this is on the radar yet or if it’s considered too early to address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that have a question which should be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions