chore(trading): liquidity provision, change query for set flag live on true (#3335)

This commit is contained in:
Maciek 2023-03-31 15:20:44 +02:00 committed by GitHub
parent bd3b557f3d
commit 2bfc3abd15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 18 deletions

View File

@ -57,7 +57,7 @@ fragment LiquidityProvisionFields on LiquidityProvision {
query LiquidityProvisions($marketId: ID!) {
market(id: $marketId) {
liquidityProvisionsConnection {
liquidityProvisionsConnection(live: true) {
edges {
node {
...LiquidityProvisionFields

View File

@ -1,6 +1,6 @@
fragment MarketNode on Market {
id
liquidityProvisionsConnection {
liquidityProvisionsConnection(live: true) {
edges {
node {
commitmentAmount

View File

@ -138,7 +138,7 @@ export type MarketLpQueryResult = Apollo.QueryResult<MarketLpQuery, MarketLpQuer
export const LiquidityProvisionsDocument = gql`
query LiquidityProvisions($marketId: ID!) {
market(id: $marketId) {
liquidityProvisionsConnection {
liquidityProvisionsConnection(live: true) {
edges {
node {
...LiquidityProvisionFields
@ -290,4 +290,4 @@ export function useLiquidityProviderFeeShareUpdateSubscription(baseOptions: Apol
return Apollo.useSubscription<LiquidityProviderFeeShareUpdateSubscription, LiquidityProviderFeeShareUpdateSubscriptionVariables>(LiquidityProviderFeeShareUpdateDocument, options);
}
export type LiquidityProviderFeeShareUpdateSubscriptionHookResult = ReturnType<typeof useLiquidityProviderFeeShareUpdateSubscription>;
export type LiquidityProviderFeeShareUpdateSubscriptionResult = Apollo.SubscriptionResult<LiquidityProviderFeeShareUpdateSubscription>;
export type LiquidityProviderFeeShareUpdateSubscriptionResult = Apollo.SubscriptionResult<LiquidityProviderFeeShareUpdateSubscription>;

View File

@ -13,7 +13,7 @@ export type LiquidityProvisionMarketsQuery = { __typename?: 'Query', marketsConn
export const MarketNodeFragmentDoc = gql`
fragment MarketNode on Market {
id
liquidityProvisionsConnection {
liquidityProvisionsConnection(live: true) {
edges {
node {
commitmentAmount

View File

@ -65,23 +65,11 @@ export const liquidityProvisionsDataProvider = makeDataProvider<
});
},
getData: (responseData: LiquidityProvisionsQuery | null) => {
// to remove dedupe after core fix https://github.com/vegaprotocol/vega/issues/8043
const dedupeArr: string[] = [];
return (
responseData?.market?.liquidityProvisionsConnection?.edges?.map(
(e) => e?.node
) ?? []
).filter((e) => {
if (e) {
const id = getId(e);
if (dedupeArr.includes(id)) {
return false;
}
dedupeArr.push(id);
return true;
}
return false;
}) as LiquidityProvisionFieldsFragment[];
).filter((e) => !!e) as LiquidityProvisionFieldsFragment[];
},
getDelta: (
subscriptionData: LiquidityProvisionsUpdateSubscription