apollo-ios: Problem with `schemaName`

Bug report

  • Thanks for the 1.0.0 release! ❤️ I just integrated it into our testing project, and I have one particular problem with schemaName

Steps to reproduce

  • I’m using ModuleType.embeddedInTarget and TestMockFileOutput.absolute options.
  • When schemaName is in lowercase ("schemaName": "rocket" for example), the rocket.graphql.swift with the Rocket caseless namespace enum is created. However, the generated Mocks are not working, because there is rocket instead of Rocket.
  • When I change the schemaName to start with the capitalized letter ("schemaName": "Rocket" for example), the file with caseless namespace enum isn’t created at all. 😔

New Project Screenshot 2022-10-04 at 14 21 02

Versions

  • apollo-ios SDK version: 1.0.0
  • Xcode version: 14.0
  • Swift version: 5.7
  • Package manager: SPM

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments

I’m closing this issue since we’ve addressed the initial issues and we will track the bug related to pruneGeneratedFiles in https://github.com/apollographql/apollo-ios/issues/2665 instead.

1.0.2 included a fix for the first two problems we identified in this issue:

There is one bug left before we can close out this issue and that is the missing file; some users have indicated that pruneGeneratedFiles is causing the bug. We’ll do our best to get a fix out for that in 1.0.3.

Same here! "pruneGeneratedFiles": false fixes it! 😃

Thanks for alerting us to this one. Supports a lowercase named schema here should be an easy fix, we’ll get a PR up for that ASAP and release it as part of the first patch version. (We’re at GraphQL summit this week, so that will probably be on Monday when we’re back!)

When I change the schemaName to start with the capitalized letter (“schemaName”: “Rocket” for example), the file with caseless namespace enum isn’t created at all. 😔

This definitely shouldn’t be happening. I’m not sure why it would not create the enum. I’ll see if we can reproduce that…