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

Enhancement Request: Recursively Publish Multiple Schema Files in a Directory #731

Open
Muchogoc opened this issue Apr 14, 2024 · 4 comments
Labels
enhancement New feature or request internally-reviewed The issue has been reviewed internally.

Comments

@Muchogoc
Copy link

Component(s)

cli

Is your feature request related to a problem? Please describe.

The current behavior of the wgc CLI restricts schema publishing to a single file. However, it’s common to have multiple related schema files organized within a directory. For instance, to prevent excessively long files and to group related queries and mutations together.
In my current setup uploading each schema file one by one is impossible due to validation errors: Error: The type "MyType" was referenced in the schema, but it was never defined..

Describe the solution you'd like

I propose enhancing the CLI to support recursive schema publishing. This would allow users to specify a directory containing multiple schema files and optionally a file extension e.g .graphql or .gql. It can have a default extension.

The CLI should publish all of them as part of the same subgraph/monograph. This feature would greatly improve the usability and flexibility of the tool, especially for projects with complex schemas.

Describe alternatives you've considered

No response

Additional context

No response

@Muchogoc Muchogoc added the enhancement New feature or request label Apr 14, 2024
Copy link

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.

@Aenimus
Copy link
Member

Aenimus commented Apr 15, 2024

Hi @Muchogoc,

Please correct me if I am wrong, but let me check I understand the situation. You have what you consider to be a single schema, but the schema itself is split across multiple files for organizational purposes?

Consequently, schema A-1 makes reference to "MyType", which is defined in schema A-2. Something to that effect? But you'd like to upload the schemas together as a single file?

Is there a reason you cannot pre-process your sub-schemas to join them together and publish that?

@jensneuse jensneuse added the internally-reviewed The issue has been reviewed internally. label Apr 16, 2024
@Muchogoc
Copy link
Author

Hi @Aenimus, your understanding of the situation is correct.

Pre-processing is possible,I have used it as a workaround locally to use a script and run checks/publish.
I believe it would be a convenience to directly use the wgc command especially on CI and in a team setting rather than having to use a script for it.

@Muchogoc
Copy link
Author

I have also worked on a similar problem where I added similar functionality to a CLI that published schema files to a schema registry as a single schema and willing to work on it for the wgc CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internally-reviewed The issue has been reviewed internally.
Projects
None yet
Development

No branches or pull requests

3 participants