Skip to content

Commit

Permalink
fix: 🐛 fix schema import on windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed Oct 7, 2023
1 parent a41a7c0 commit f0e7678
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/declarations_writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import glob from 'fast-glob';
import { dirname, relative } from 'path';
import { normalizePath } from 'vite';
import { DocumentNode } from 'graphql';
import { sep } from 'node:path';

const MINIMATCH_PATTERNS = ['**/*.gql', '**/*.graphql'];

Expand All @@ -23,7 +24,7 @@ export class DeclarationWriter {
await writeOperationDeclarations(
path,
this.schema,
`import {\n ${this.schemaExports.join(',\n ')}\n} from '${relative(dirname(path), this.schemaPath)}';\n`
`import {\n ${this.schemaExports.join(',\n ')}\n} from '${relative(dirname(path), this.schemaPath).split(sep).join('/')}';\n`
);
}

Expand Down

0 comments on commit f0e7678

Please sign in to comment.