From b291dbda2d64e868d0f959905573f3a431187fa0 Mon Sep 17 00:00:00 2001
From: paidge <paidge_cs@hotmail.com>
Date: Mon, 7 Nov 2022 16:54:11 +0100
Subject: [PATCH] add axiom-team server

---
 components/apollo/List.vue      |  2 +-
 graphql/endpoints/axiom-team.js | 26 ++++++++++++++++++++++++++
 nuxt.config.js                  |  3 ++-
 package.json                    |  2 +-
 web-ext/manifest.json           |  2 +-
 5 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 graphql/endpoints/axiom-team.js

diff --git a/components/apollo/List.vue b/components/apollo/List.vue
index ad1b759..6db91ab 100644
--- a/components/apollo/List.vue
+++ b/components/apollo/List.vue
@@ -13,7 +13,7 @@
 					clientName
 						.split(/(?=[A-Z])/)
 						.map((s) => s.toLowerCase())
-						.join(".")
+						.join("-")
 				}}
 			</option>
 		</select>
diff --git a/graphql/endpoints/axiom-team.js b/graphql/endpoints/axiom-team.js
new file mode 100644
index 0000000..12cfe2f
--- /dev/null
+++ b/graphql/endpoints/axiom-team.js
@@ -0,0 +1,26 @@
+import { HttpLink } from "apollo-link-http"
+import { setContext } from "apollo-link-context"
+import { from } from "apollo-link"
+import { cache } from "../cache"
+
+export default (ctx) => {
+	const ssrMiddleware = setContext((_, { headers }) => {
+		if (process.client) return headers
+		return {
+			headers
+		}
+	})
+
+	const httpLink = new HttpLink({
+		uri: "https://gql.wotwizard.axiom-team.fr/"
+	})
+
+	const link = from([ssrMiddleware, httpLink])
+
+	return {
+		link,
+		cache,
+		// https://github.com/nuxt-community/apollo-module/issues/306#issuecomment-607225431
+		defaultHttpLink: false
+	}
+}
diff --git a/nuxt.config.js b/nuxt.config.js
index 3031e2f..a87972a 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -127,7 +127,8 @@ export default {
 
 	apollo: {
 		clientConfigs: {
-			trentesaux: "~/graphql/endpoints/trentesaux"
+			trentesaux: "~/graphql/endpoints/trentesaux",
+			axiomTeam: "~/graphql/endpoints/axiom-team"
 		}
 	},
 
diff --git a/package.json b/package.json
index aca3ec6..2edf241 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "wotwizard-ui",
-	"version": "2.5.0",
+	"version": "2.5.1",
 	"private": true,
 	"scripts": {
 		"dev": "nuxt",
diff --git a/web-ext/manifest.json b/web-ext/manifest.json
index 8c14f03..31e7b9d 100644
--- a/web-ext/manifest.json
+++ b/web-ext/manifest.json
@@ -2,7 +2,7 @@
 	"manifest_version": 2,
 	"name": "Wotwizard UI",
 	"description": "Le magicien de la toile de confiance",
-	"version": "2.5.0",
+	"version": "2.5.1",
 	"homepage_url": "https://wotwizard.axiom-team.fr",
 	"browser_action": {
 		"browser_style": true,
-- 
GitLab