Giter Club home page Giter Club logo

Comments (6)

calvincestari avatar calvincestari commented on June 2, 2024 1

I believe this is a known issue @michaelloo, and unfortunately we don't have a workaround that isn't manual at the moment. Xcode really should just be able to handle this to be honest. A solution that works with codegen may have to be adding a name suffix to each file with what kind it is; AddressInputObject, AddressObject, etc.

from apollo-ios.

michaelloo avatar michaelloo commented on June 2, 2024

😢 Ah ok... we'll have a script them to rename the file for now after updating the models, thanks for the response!

from apollo-ios.

michaelloo avatar michaelloo commented on June 2, 2024

Hi @calvincestari , on a somewhat related note, what is the suggested approach if we have the same codebase relying on multiple APIs with different GraphQL schemas? Meaning having multiple apollo-codegen-config.json files but the generate code might have filename conflict, e.g.:

error: Filename "SchemaConfiguration.swift" used twice: 'some/path/GeneratedFiles/Schema/SchemaConfiguration.swift' and 'some/other/path/GeneratedFiles/Schema/SchemaConfiguration.swift' (in target 'XXX' from project 'XXX')

from apollo-ios.

calvincestari avatar calvincestari commented on June 2, 2024

Apollo iOS is not designed to work with multiple schemas at once and to do so requires a bit of careful configuration.

To resolve the duplicate SchemaConfiguration.swift you'll need to generate the schemas into different targets/packages, I believe that should resolve the issue.

from apollo-ios.

michaelloo avatar michaelloo commented on June 2, 2024

I see, we'll get onto that but this isn't an ideal solution so i've opened a separate feature request here 🙏

from apollo-ios.

AnthonyMDev avatar AnthonyMDev commented on June 2, 2024

A workaround for this is being implemented currently. See #3283 for more info. Once that is released, you'll be able to change the generated names of these types (including file names) to AddressInputObject and AddressType (or any names you choose).

from apollo-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.