Skip to content

Conversation

@martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Oct 31, 2025

Add FragmentCycle. See #6756

It's not really possible to ignore it at the moment because the codegen relies on that fact in usedFragments and also when generating CompiledFields.

The following fails because there is a chicken/egg problem in the initialization of __root:

public object FooDetailsSelections {
  public val __root: List<CompiledSelection> = listOf(
        CompiledField.Builder(
          name = "__typename",
          type = GraphQLString.type.notNull()
        ).build(),
        CompiledFragment.Builder(
          typeCondition = "Foo",
          possibleTypes = listOf("Foo")
        ).selections(FooDetailsSelections.__root)
        .build()
      )
}

@martinbonnin martinbonnin requested a review from BoD as a code owner October 31, 2025 11:01
@apollo-librarian
Copy link

apollo-librarian bot commented Oct 31, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: cbf4dda5bb8ca1f1d23f2a7b
Build Logs: View logs

@martinbonnin martinbonnin changed the title Add a specific type for fragment cycles Add a specific issue type for fragment cycles Oct 31, 2025
@martinbonnin martinbonnin merged commit 733c00c into main Oct 31, 2025
7 checks passed
@martinbonnin martinbonnin deleted the recursive-fragment branch October 31, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants