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

The watch mode for schema files does not work when using the glob pattern #34

Closed
stenin-nikita opened this issue Nov 22, 2024 · 2 comments
Labels
enhancement New feature or request released

Comments

@stenin-nikita
Copy link

If I specify the global pattern in the "schema" field, the plugin will not respond to changes in these files.

// codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
  schema: 'src/server/**/*.graphql',
  documents: 'src/client/**/*.graphql',
  generates: {
    'src/client/__generated__/graphql.ts': {
      plugins: ['typescript', 'typescript-operations'],
    },
    'build/schema.graphql': {
      plugins: ['schema-ast'],
    },
  },
};

export default config;
// vite.config.ts
import { defineConfig } from 'vite';
import codegen from 'vite-plugin-graphql-codegen';

export default defineConfig({
  plugins: [
    codegen({
      matchOnSchemas: true,
    }),
  ],
});

Reproduction url: https://stackblitz.com/edit/vitejs-vite-vegtzm

@danielwaltz danielwaltz added the enhancement New feature or request label Nov 22, 2024
@danielwaltz
Copy link
Owner

Good news, someone has just recently opened a PR to add support for this! I am hoping to get enough to to properly test in the next couple weeks.

#33

github-actions bot pushed a commit that referenced this issue 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 issue has been resolved 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

No branches or pull requests

2 participants