-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
Hey!
I'm generating the introspection types in a directory that is git-ignored, and graphqlsp does not create this directory automatically if not found
What do you think about adding something roughly like this?
if (output.endsWith('.ts')) {
await mkdir(path.dirname(output), { recursive: true });
}
(with proper error handling of course)
Ref:
GraphQLSP/packages/graphqlsp/src/graphql/getSchema.ts
Lines 78 to 87 in acede9b
let output = tadaOutputLocation; | |
if (await statFile(output, stat => stat.isDirectory())) { | |
output = path.join(output, 'introspection.d.ts'); | |
} else if ( | |
!(await statFile(path.dirname(output), stat => stat.isDirectory())) | |
) { | |
logger(`Output file is not inside a directory @ ${output}`); | |
return; | |
} |
I'd be happy to contribute a pull request if this change is accepted
Metadata
Metadata
Assignees
Labels
No labels