Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codegen] add additionalImportedModulesNames to apollo codegen config #156

Conversation

hemel
Copy link

@hemel hemel commented Nov 29, 2023

The purpose of this change is to give codegen the capability to add custom import statements to generated operations.
This change would enable the consumer to share fragments across generated packages.

Addresses this thread:

apollographql/apollo-ios#3284

@hemel hemel requested a review from a team as a code owner November 29, 2023 22:09
Hemel Yahya added 3 commits November 29, 2023 15:18
…alImportedModulesNamespaces to additionalImportedModulesNames
…alImportedModulesNamespaces to additionalImportedModulesNames
…alImportedModulesNamespaces to additionalImportedModulesNames
@calvincestari
Copy link
Member

Thanks for the PR @hemel but I don't think this correctly solves the issue in apollographql/apollo-ios#3284.

The problem description is three modules (A, B, C) and only two (A, B) need to share the fragments (D); C should not import D. Your solution essentially replicates putting the fragments into the shared schema module which all operation files already import.

I'm going to close this PR but if you want to keep iterating on it please go ahead. Manipulating the templates is the easy part but finding an elegant configuration model is the difficult part.

@jimisaacs
Copy link
Contributor

@hemel I'm confused, these don't look like all the changes we landed on? Can you share some context?

@jimisaacs
Copy link
Contributor

@hemel nevermind, was confused found #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants