Skip to content

Commit

Permalink
Merge pull request #104 from Premian-Labs/issue/allowErrors
Browse files Browse the repository at this point in the history
Add error policy to critical fragments
  • Loading branch information
froggiedev committed Apr 30, 2024
2 parents fc48bbf + feb67a1 commit ba369ff
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@premia/v3-sdk",
"version": "2.7.0",
"version": "2.7.1",
"description": "The official SDK for building applications on Premia V3.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
12 changes: 8 additions & 4 deletions src/services/subgraph/graphql/queries/optionPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export class OptionPositionQuery {
${OptionPositionFragment}
{
optionPosition(id: "${this.optionPositionId(owner, poolAddress)}") {
optionPosition(id: "${this.optionPositionId(owner, poolAddress)}",
subgraphError: allow) {
...OptionPosition
}
}
Expand All @@ -39,7 +40,8 @@ export class OptionPositionQuery {
${OptionPositionExtendedFragment}
{
optionPosition(id: "${this.optionPositionId(owner, poolAddress)}") {
optionPosition(id: "${this.optionPositionId(owner, poolAddress)}",
subgraphError: allow) {
...OptionPositionExtended
}
}
Expand Down Expand Up @@ -74,7 +76,8 @@ export class OptionPositionQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...OptionPositionExtended
}
Expand Down Expand Up @@ -105,7 +108,8 @@ export class OptionPositionQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...OptionPositionExtended
}
Expand Down
33 changes: 22 additions & 11 deletions src/services/subgraph/graphql/queries/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class PoolQuery {
${PoolMinimalFragment}
{
pool(id: "${this.poolId(address)}") {
pool(id: "${this.poolId(address)}",
subgraphError: allow) {
...PoolMinimal
}
}
Expand All @@ -39,7 +40,8 @@ export class PoolQuery {
${PoolFragment}
{
pool(id: "${this.poolId(address)}") {
pool(id: "${this.poolId(address)}",
subgraphError: allow) {
...Pool
}
}
Expand All @@ -55,7 +57,8 @@ export class PoolQuery {
${PoolExtendedFragment}
{
pool(id: "${this.poolId(address)}") {
pool(id: "${this.poolId(address)}",
subgraphError: allow) {
...PoolExtended
}
}
Expand Down Expand Up @@ -87,7 +90,8 @@ export class PoolQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...Pool
}
Expand Down Expand Up @@ -120,7 +124,8 @@ export class PoolQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...PoolExtended
}
Expand Down Expand Up @@ -175,7 +180,8 @@ export class PoolQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...PoolMinimal
}
Expand All @@ -199,7 +205,8 @@ export class PoolQuery {
)}" },
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...Pool
}
Expand Down Expand Up @@ -251,7 +258,8 @@ export class PoolQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...Pool
}
Expand Down Expand Up @@ -300,7 +308,8 @@ export class PoolQuery {
},
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...PoolExtended
}
Expand All @@ -321,7 +330,8 @@ export class PoolQuery {
where: { pair: "${_pairId.toLowerCase()}" },
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...Pool
}
Expand All @@ -342,7 +352,8 @@ export class PoolQuery {
where: { pair: "${_pairId.toLowerCase()}" }
first: 1000,
orderBy: createdAt,
orderDirection: desc
orderDirection: desc,
subgraphError: allow
) {
...PoolExtended
}
Expand Down
18 changes: 12 additions & 6 deletions src/services/subgraph/graphql/queries/tokenPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export class TokenPairQuery {
${TokenPairFragment}
{
tokenPair(id: "${pairId}") {
tokenPair(id: "${pairId}",
subgraphError: allow) {
...TokenPair
}
}
Expand All @@ -47,7 +48,8 @@ export class TokenPairQuery {
${TokenPairExtendedFragment}
{
tokenPair(id: "${pairId}") {
tokenPair(id: "${pairId}",
subgraphError: allow) {
...TokenPairExtended
}
}
Expand All @@ -62,7 +64,8 @@ export class TokenPairQuery {
{
tokenPairs(where: {
id_in: [${pairIds.map((id) => `"${id}"`).join(', ')}]
}) {
},
subgraphError: allow) {
...TokenPair
}
}
Expand All @@ -80,7 +83,8 @@ export class TokenPairQuery {
{
tokenPairs(where: {
id_in: [${pairIds.map((id) => `"${id}"`).join(', ')}]
}) {
},
subgraphError: allow) {
...TokenPairExtended
}
}
Expand All @@ -93,7 +97,8 @@ export class TokenPairQuery {
${TokenPairFragment}
{
tokenPairs(first: 250) {
tokenPairs(first: 250,
subgraphError: allow) {
...TokenPair
}
}
Expand All @@ -106,7 +111,8 @@ export class TokenPairQuery {
${TokenPairExtendedFragment}
{
tokenPairs {
tokenPairs(
subgraphError: allow) {
...TokenPairExtended
}
}
Expand Down
14 changes: 9 additions & 5 deletions src/services/subgraph/graphql/queries/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export class VaultQuery {
${VaultFragment}
{
vault(id: "${this.vaultId(address)}") {
vault(id: "${this.vaultId(address)}",
subgraphError: allow) {
...Vault
}
}
Expand All @@ -33,7 +34,8 @@ export class VaultQuery {
${VaultExtendedFragment}
{
vault(id: "${this.vaultId(address)}") {
vault(id: "${this.vaultId(address)}",
subgraphError: allow) {
...VaultExtended
}
}
Expand All @@ -46,7 +48,7 @@ export class VaultQuery {
${VaultExtendedFragment}
{
vaults {
vaults(subgraphError: allow) {
...VaultExtended
}
}
Expand All @@ -62,7 +64,8 @@ export class VaultQuery {
${VaultFragment}
{
vaults(where: { asset: "${tokenAddress.toLowerCase()}" }) {
vaults(where: { asset: "${tokenAddress.toLowerCase()}" },
subgraphError: allow) {
...Vault
}
}
Expand All @@ -78,7 +81,8 @@ export class VaultQuery {
${VaultExtendedFragment}
{
vaults(where: { asset: "${tokenAddress.toLowerCase()}" }) {
vaults(where: { asset: "${tokenAddress.toLowerCase()}" },
subgraphError: allow) {
...VaultExtended
}
}
Expand Down

0 comments on commit ba369ff

Please sign in to comment.