From bf8a05c5e8dfb1d5b6cebb317040b7d593c49938 Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Wed, 23 Aug 2023 13:29:29 +0200 Subject: [PATCH] prod path deploy fix test --- .meshrc.yml | 2 +- src/envelopePlugin.ts | 1 - src/fetch-schema.js | 2 +- src/resolvers/directus_subscriptions.js | 2 +- {schemas => src/schemas}/cloudron.json | 0 {schemas => src/schemas}/directus.graphql | 0 {schemas => src/schemas}/gitea.yml | 0 {schemas => src/schemas}/gridproxy.json | 0 8 files changed, 3 insertions(+), 4 deletions(-) rename {schemas => src/schemas}/cloudron.json (100%) rename {schemas => src/schemas}/directus.graphql (100%) rename {schemas => src/schemas}/gitea.yml (100%) rename {schemas => src/schemas}/gridproxy.json (100%) diff --git a/.meshrc.yml b/.meshrc.yml index f6d496a..da977d2 100644 --- a/.meshrc.yml +++ b/.meshrc.yml @@ -6,7 +6,7 @@ sources: handler: graphql: endpoint: https://directus.andert.me/graphql - source: schemas/directus.graphql + source: ./src/schemas/directus.graphql operationHeaders: Authorization: Bearer {env.DIRECTUS_API} additionalResolvers: diff --git a/src/envelopePlugin.ts b/src/envelopePlugin.ts index 1b8ef77..e34e418 100644 --- a/src/envelopePlugin.ts +++ b/src/envelopePlugin.ts @@ -10,7 +10,6 @@ const resolveUserFn = async (context: any) => { const authHeader = context.req.headers.authorization; const authtoken = process.env.GRAPHQL_MESH if (authHeader !== authtoken) { - console.error('Failed to validate token') return null } return { id: 'user1' }; diff --git a/src/fetch-schema.js b/src/fetch-schema.js index 1be9795..68bf292 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('./schemas/directus.graphql', schema); + fs.writeFileSync('./src/schemas/directus.graphql', schema); } fetchSchema().catch(console.error); diff --git a/src/resolvers/directus_subscriptions.js b/src/resolvers/directus_subscriptions.js index 09d752c..adc64b1 100644 --- a/src/resolvers/directus_subscriptions.js +++ b/src/resolvers/directus_subscriptions.js @@ -7,7 +7,7 @@ const fs = require('fs'); const pubsub = new PubSub(); // Read the schema file -const schema = fs.readFileSync('./schemas/directus.graphql', 'utf8'); +const schema = fs.readFileSync('./src/schemas/directus.graphql', 'utf8'); // Parse the schema const document = parse(schema); diff --git a/schemas/cloudron.json b/src/schemas/cloudron.json similarity index 100% rename from schemas/cloudron.json rename to src/schemas/cloudron.json diff --git a/schemas/directus.graphql b/src/schemas/directus.graphql similarity index 100% rename from schemas/directus.graphql rename to src/schemas/directus.graphql diff --git a/schemas/gitea.yml b/src/schemas/gitea.yml similarity index 100% rename from schemas/gitea.yml rename to src/schemas/gitea.yml diff --git a/schemas/gridproxy.json b/src/schemas/gridproxy.json similarity index 100% rename from schemas/gridproxy.json rename to src/schemas/gridproxy.json