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

Support glob paths in schema #33

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

Nnigmat
Copy link
Contributor

@Nnigmat Nnigmat commented Nov 20, 2024

Problem

I work on a project and we have many schema files, which we are collecting using glob, e.g. src/server/**/*.graphql.

After saving those files the watch mode codegen process does not start.

Solution

To solve this problem we can use loadSchema function which works as loadDocuments function. It takes array of paths and glob-patterns and returns array of normalized file paths.

We use this paths to match changed files.

Notes

Function loadSchema have a bug with typings. In the type definition says that it accepts only one schema pointer. But function use another module which supports array of schema pointers too.

I have created an issue to @graphql-codegen/cli - dotansimha/graphql-code-generator#10196

@danielwaltz
Copy link
Owner

Thanks for your contribution! I will give it a closer look as soon as I am able to. ❤️

@danielwaltz danielwaltz added the enhancement New feature or request label Nov 22, 2024
@danielwaltz danielwaltz merged commit 2efef2e into danielwaltz:main Nov 23, 2024
2 checks passed
@danielwaltz
Copy link
Owner

This is awesome. Really appreciate you taking the time to write a test for it as well. Thanks!

github-actions bot pushed a commit that referenced this pull request Nov 23, 2024
## [3.4.0](v3.3.8...v3.4.0) (2024-11-23)

### Features

* support glob paths in schema ([#33](#33)) ([2efef2e](2efef2e)), closes [#34](#34)

### Continuous Integration

* update github action versions ([0c656ab](0c656ab))

### Miscellaneous Chores

* update node to `v22.11.0` lts ([d941f32](d941f32))
* use `.node-version` file ([863a61a](863a61a))
Copy link

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants