diff --git a/components/ui/graphql/src/main.ts b/components/ui/graphql/src/main.ts index 34c8440..057c02c 100644 --- a/components/ui/graphql/src/main.ts +++ b/components/ui/graphql/src/main.ts @@ -5,7 +5,6 @@ import { ApolloServer } from '@apollo/server'; import { expressMiddleware } from '@apollo/server/express4'; import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default'; -import { addMocksToSchema } from '@graphql-tools/mock'; import { makeExecutableSchema } from '@graphql-tools/schema'; import express from 'express'; import http from 'http'; @@ -42,12 +41,7 @@ const httpServer = http.createServer(app); const schema = makeExecutableSchema({ typeDefs, resolvers }); const server = new ApolloServer({ - schema: process.env.IDIES_ENV === 'test' ? addMocksToSchema( - { - schema, - mocks: { DateTime: () => new Date() } - } - ) : schema, + schema, plugins: process.env.IDIES_ENV !== 'production' ? [ // eslint-disable-next-line new-cap diff --git a/helm/sciserver/templates/graphql/graphql-deployment.yaml b/helm/sciserver/templates/graphql/graphql-deployment.yaml index 1eaa146..43d3b20 100644 --- a/helm/sciserver/templates/graphql/graphql-deployment.yaml +++ b/helm/sciserver/templates/graphql/graphql-deployment.yaml @@ -1,3 +1,5 @@ +{{ if (not .Values.graphql.url) -}} + apiVersion: apps/v1 kind: Deployment metadata: @@ -60,3 +62,4 @@ spec: schedulerName: default-scheduler securityContext: {} terminationGracePeriodSeconds: 30 +{{ end -}} \ No newline at end of file diff --git a/helm/sciserver/templates/web/web-deployment.yaml b/helm/sciserver/templates/web/web-deployment.yaml index 0a04535..483655a 100644 --- a/helm/sciserver/templates/web/web-deployment.yaml +++ b/helm/sciserver/templates/web/web-deployment.yaml @@ -33,10 +33,12 @@ spec: resources: {{- toYaml .Values.web.resources | nindent 12 }} env: + - name: NEXT_PUBLIC_BASE_URL + value: '{{ include "sciserver.url" . }}' - name: NEXT_PUBLIC_LOGIN_PORTAL_URL value: '{{ include "sciserver.url" . }}login-portal/' - name: NEXT_PUBLIC_GRAPHQL_URL - value: '{{ include "sciserver.url" . }}graphql' + value: '{{ if .Values.graphql.url }}{{ .Values.graphql.url }}{{ else }}{{ include "sciserver.url" . }}graphql{{ end }}' - name: NEXT_PUBLIC_FILES_URL value: '{{ include "sciserver.url" . }}dashboard/files/uservolumes' - name: NEXT_PUBLIC_DASHBOARD_URL diff --git a/helm/sciserver/values.yaml b/helm/sciserver/values.yaml index 8edc1d5..9da4e11 100644 --- a/helm/sciserver/values.yaml +++ b/helm/sciserver/values.yaml @@ -459,6 +459,7 @@ web: memory: 128Mi graphql: + # url: '' If URL is set, the graphql deployment will be skipped and the url will be used for the web deployment replicaCount: 1 env: dev image: