@@ -19,6 +19,7 @@ import { GqlContextType, Session } from '~/common';
19
19
import { getRegisteredScalars } from '~/common/scalars' ;
20
20
import { ConfigService } from '../config/config.service' ;
21
21
import { VersionService } from '../config/version.service' ;
22
+ import { apolloExplorer } from './apollo-explorer' ;
22
23
import { isGqlContext } from './gql-context.host' ;
23
24
import { GraphqlTracingPlugin } from './graphql-tracing.plugin' ;
24
25
@@ -41,6 +42,7 @@ export class GraphqlOptions implements GqlOptionsFactory {
41
42
if ( version . hash ) {
42
43
process . env . APOLLO_SERVER_USER_VERSION = version . hash ;
43
44
}
45
+ const graphRef = process . env . APOLLO_GRAPH_REF ;
44
46
45
47
const scalars = mapKeys . fromList (
46
48
getRegisteredScalars ( ) ,
@@ -52,10 +54,20 @@ export class GraphqlOptions implements GqlOptionsFactory {
52
54
path : '/graphql/:opName?' ,
53
55
autoSchemaFile : 'schema.graphql' ,
54
56
graphiql : {
55
- title : 'CORD API ' ,
57
+ title : graphRef ?? 'CORD@local ' ,
56
58
defaultEditorToolsVisibility : false ,
57
59
credentials : 'include' ,
58
60
} ,
61
+ renderGraphiQL : ( ) =>
62
+ apolloExplorer ( {
63
+ title : graphRef ?? 'CORD@local' ,
64
+ graphRef : graphRef ,
65
+ endpointIsEditable : false ,
66
+ hideCookieToggle : true ,
67
+ initialState : {
68
+ includeCookies : true ,
69
+ } ,
70
+ } ) ,
59
71
context : this . context ,
60
72
maskedErrors : false , // Errors are formatted in plugin
61
73
sortSchema : true ,
0 commit comments