Bug report
Just came across a small sharp edge in the API for codegen – specifying the OutputFormat has no effect, and the output format (single vs multiple files) is only a property of the URL passed in.
This is noted in a comment in the source code, so seems to already be acknowledged as an issue. Given that the API provided affords that this would work in a particular way, and that it doesn't in fact do this, I think it would be good to fix it.
I can see why it would be nice to be able to express the choice in a way that isn't just part of the URL passed in, but the inconsistency means that the documentation aspect can be incorrect, which I think is worse than not having it.
Suggestions
I'd suggest one of two fixes:
- Drop the
OutputFormat and take a URL, documenting the behaviour given different properties of the URL.
- Keep the
OutputFormat and raise an exception if the URL passed in doesn't conform to expectations.
I think it's nice to have the documentation in the API, and maintaining backwards compatibility is always good, so I'd have a preference for option 2. This exception would also not technically break backwards compatibility as I think the compatibility is framed in terms of documentation rather than behaviour, but please do correct me on this if I'm wrong!
Contributions
Would you accept a PR for this? Can we treat this issue as a design discussion for that contribution?
Versions
apollo-ios SDK version: 0.34.1
- Xcode version: 12.3
- Swift version: 5.3
- Package manager: SPM
Bug report
Just came across a small sharp edge in the API for codegen – specifying the
OutputFormathas no effect, and the output format (single vs multiple files) is only a property of theURLpassed in.This is noted in a comment in the source code, so seems to already be acknowledged as an issue. Given that the API provided affords that this would work in a particular way, and that it doesn't in fact do this, I think it would be good to fix it.
I can see why it would be nice to be able to express the choice in a way that isn't just part of the URL passed in, but the inconsistency means that the documentation aspect can be incorrect, which I think is worse than not having it.
Suggestions
I'd suggest one of two fixes:
OutputFormatand take aURL, documenting the behaviour given different properties of theURL.OutputFormatand raise an exception if theURLpassed in doesn't conform to expectations.I think it's nice to have the documentation in the API, and maintaining backwards compatibility is always good, so I'd have a preference for option 2. This exception would also not technically break backwards compatibility as I think the compatibility is framed in terms of documentation rather than behaviour, but please do correct me on this if I'm wrong!
Contributions
Would you accept a PR for this? Can we treat this issue as a design discussion for that contribution?
Versions
apollo-iosSDK version: 0.34.1