diff --git a/package.json b/package.json index 4fa5a99..8f222bb 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "0.1.0", "private": true, "scripts": { + "fetch-directus-schema": "dotenv -- node ./src/fetch-schema.js", "mesh:dev": "dotenv -e .env.local -- mesh build", "next:dev": "dotenv -e .env.local -- next dev", - "dev": "npm run mesh:dev && npm run next:dev", - "schema": "dotenv -- node ./src/fetch-schema.js", + "dev": "npm run fetch-directus-schema && npm run mesh:dev && npm run next:dev", "mesh:build": "dotenv -e .env.production -- mesh build", "next:build": "dotenv -e .env.production -- next build", "build": "npm run mesh:build && npm run next:build", diff --git a/src/envelopePlugin.ts b/src/envelopePlugin.ts index 4ef3fb8..3815756 100644 --- a/src/envelopePlugin.ts +++ b/src/envelopePlugin.ts @@ -22,7 +22,7 @@ const validateUser = (params: any) => { } } -const plugins: MeshPlugin = [ +const plugins: MeshPlugin = [ useGenericAuth({ resolveUserFn, validateUser, diff --git a/src/fetch-schema.js b/src/fetch-schema.js index e69322a..1be9795 100644 --- a/src/fetch-schema.js +++ b/src/fetch-schema.js @@ -24,7 +24,7 @@ async function fetchSchema() { }); // Save the schema to a file - fs.writeFileSync('./schema/directus.graphql', schema); + fs.writeFileSync('./schemas/directus.graphql', schema); } fetchSchema().catch(console.error);