Linking codegen-cli generated files into project

Hi Guys, i am new here, i am working on an update of an implementation from GraphQL iOS 0.51.2 to 1.0.3 and i am having some trouble.

I have configured succesfully the apollo-codegen-config.json, without any issue, it can generate all files i need from a JSON Schema. On a small POC projecy i am able to generate the SPM package, import it and it is working fine. On the project, when i do that, when i import the SPM package it just does not work, so i am opting for generating files as a Module or Other, on this scenario since everything is modularized i chose module type Other, but the problem i am facing is that generated files are not being added to the actual target and they are not being linked into the project.
If i export it as a module, i need to manually add the files which is not a solution.

Any thoughts on this?
Thank you!

Hi @Santiago :wave:

the project, when i do that, when i import the SPM package it just does not work

Can you share a bit more detail about what doesn’t work?

so i am opting for generating files as a Module or Other, on this scenario since everything is modularized i chose module type Other, but the problem i am facing is that generated files are not being added to the actual target and they are not being linked into the project.
If i export it as a module, i need to manually add the files which is not a solution.

There are two other supported module types:

  • embeddedInTarget which will require you to manually add each file to your project target. It sounds like you don’t want to do this.
  • other is meant for other dependency manager such as CocoaPods which requires you to already have the pod configured and waiting for the generated files to be put into the correct path.

Hope that helps clarify the module types.