mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-20 15:09:02 +03:00
Fix remote relationship test setup.
### Description This small PR fixes a few errors in the setup of remote relationships. We were not using the proper local state setup functions coming from the LHS context, and the RHS function for remote relationships was misnamed. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3749 GitOrigin-RevId: 5f261aced6bf5dbb05749af10c59e01a9214ea11
This commit is contained in:
parent
502c9afa4e
commit
0fad2485f3
@ -47,7 +47,7 @@ combine :: LHSContext -> RHSContext -> Context (Maybe Server)
|
||||
combine lhs (tableName, rhs) =
|
||||
Context
|
||||
{ name = Context.Combine lhsName rhsName,
|
||||
mkLocalState = lhsPostgresMkLocalState,
|
||||
mkLocalState = lhsMkLocalState,
|
||||
setup = \(state, localState) -> do
|
||||
GraphqlEngine.clearMetadata state
|
||||
rhsSetup (state, ())
|
||||
@ -59,10 +59,19 @@ combine lhs (tableName, rhs) =
|
||||
Context.combineOptions lhsOptions rhsOptions
|
||||
}
|
||||
where
|
||||
Context {name = lhsName, setup = lhsSetup, teardown = lhsTeardown, customOptions = lhsOptions} =
|
||||
lhs tableName
|
||||
Context {name = rhsName, setup = rhsSetup, teardown = rhsTeardown, customOptions = rhsOptions} =
|
||||
rhs
|
||||
Context
|
||||
{ name = lhsName,
|
||||
mkLocalState = lhsMkLocalState,
|
||||
setup = lhsSetup,
|
||||
teardown = lhsTeardown,
|
||||
customOptions = lhsOptions
|
||||
} = lhs tableName
|
||||
Context
|
||||
{ name = rhsName,
|
||||
setup = rhsSetup,
|
||||
teardown = rhsTeardown,
|
||||
customOptions = rhsOptions
|
||||
} = rhs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -41,7 +41,7 @@ combine :: LHSContext -> RHSContext -> Context (Maybe Server)
|
||||
combine lhs (tableName, rhs) =
|
||||
Context
|
||||
{ name = Context.Combine lhsName rhsName,
|
||||
mkLocalState = lhsPostgresMkLocalState,
|
||||
mkLocalState = lhsMkLocalState,
|
||||
setup = \(state, localState) -> do
|
||||
GraphqlEngine.clearMetadata state
|
||||
rhsSetup (state, ())
|
||||
@ -55,6 +55,7 @@ combine lhs (tableName, rhs) =
|
||||
where
|
||||
Context
|
||||
{ name = lhsName,
|
||||
mkLocalState = lhsMkLocalState,
|
||||
setup = lhsSetup,
|
||||
teardown = lhsTeardown,
|
||||
customOptions = lhsOptions
|
||||
|
@ -44,8 +44,8 @@ mkContext lhs =
|
||||
Context
|
||||
{ name = lhsName,
|
||||
mkLocalState = \state -> do
|
||||
rhsServer <- rhsPostgresMkLocalState state
|
||||
lhsServer <- lhsPostgresMkLocalState state
|
||||
rhsServer <- rhsRemoteServerMkLocalState state
|
||||
lhsServer <- lhsMkLocalState state
|
||||
pure $ LocalTestState lhsServer rhsServer,
|
||||
setup = \(state, LocalTestState lhsServer rhsServer) -> do
|
||||
GraphqlEngine.clearMetadata state
|
||||
@ -59,6 +59,7 @@ mkContext lhs =
|
||||
where
|
||||
Context
|
||||
{ name = lhsName,
|
||||
mkLocalState = lhsMkLocalState,
|
||||
setup = lhsSetup,
|
||||
teardown = lhsTeardown,
|
||||
customOptions = lhsOptions
|
||||
@ -145,8 +146,8 @@ type Query {
|
||||
|
||||
|]
|
||||
|
||||
rhsPostgresMkLocalState :: State -> IO Server
|
||||
rhsPostgresMkLocalState _ =
|
||||
rhsRemoteServerMkLocalState :: State -> IO Server
|
||||
rhsRemoteServerMkLocalState _ =
|
||||
RemoteServer.run $
|
||||
RemoteServer.generateQueryInterpreter (Query {album})
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user