File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ export class Prisma extends Binding {
44
44
const token = secret ? sign ( { } , secret ! ) : undefined
45
45
const link = makePrismaLink ( { endpoint : endpoint ! , token, debug } )
46
46
47
- const remoteSchema = getCachedRemoteSchema ( typeDefs , sharedLink )
47
+ const remoteSchema = getCachedRemoteSchema ( endpoint , typeDefs , sharedLink )
48
48
49
49
const before = ( ) => {
50
50
sharedLink . setInnerLink ( link )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { SharedLink } from './SharedLink'
4
4
import { makeRemoteExecutableSchema } from 'graphql-tools'
5
5
6
6
const typeDefsCache : { [ schemaPath : string ] : string } = { }
7
- const remoteSchemaCache : { [ typeDefs : string ] : GraphQLSchema } = { }
7
+ const remoteSchemaCache : { [ endpoint : string ] : GraphQLSchema } = { }
8
8
9
9
export function getCachedTypeDefs ( schemaPath : string ) : string {
10
10
if ( typeDefsCache [ schemaPath ] ) {
@@ -18,19 +18,19 @@ export function getCachedTypeDefs(schemaPath: string): string {
18
18
}
19
19
20
20
export function getCachedRemoteSchema (
21
+ endpoint : string ,
21
22
typeDefs : string ,
22
23
link : SharedLink ,
23
24
) : GraphQLSchema {
24
- if ( remoteSchemaCache [ typeDefs ] ) {
25
- return remoteSchemaCache [ typeDefs ]
25
+ if ( remoteSchemaCache [ endpoint ] ) {
26
+ return remoteSchemaCache [ endpoint ]
26
27
}
27
28
28
29
const remoteSchema = makeRemoteExecutableSchema ( {
29
- // TODO fix typings
30
- link : link as any ,
30
+ link : link ,
31
31
schema : typeDefs ,
32
32
} )
33
- remoteSchemaCache [ typeDefs ] = remoteSchema
33
+ remoteSchemaCache [ endpoint ] = remoteSchema
34
34
35
35
return remoteSchema
36
36
}
You can’t perform that action at this time.
0 commit comments