Skip to content

Commit

Permalink
feat(app): add graphql rate limits
Browse files Browse the repository at this point in the history
  • Loading branch information
cor committed Jun 8, 2024
1 parent f8e2569 commit 969a4df
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/chains.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { graphql } from "gql.tada"

export const chainsQueryDocument = graphql(/* GraphQL */ `query ChainsQuery {
export const chainsQueryDocument = graphql(/* GraphQL */ `query ChainsQuery @cached(ttl: 30) {
v0_chains(where: {enabled: {_eq: true}}, order_by: {display_name: asc}) {
display_name
chain_id
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/channels.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { graphql } from "gql.tada"

export const channelsQuery = graphql(/* GraphQL */ `query ChannelsQuery($limit: Int = 500) {
export const channelsQuery = graphql(/* GraphQL */ `query ChannelsQuery($limit: Int = 500) @cached(ttl: 30) {
v0_channel_map(order_by: [
{status: asc},
{from_chain_id: asc},
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/connections.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const connectionsQuery = graphql(/* GraphQL */ `
query ConnectionsQuery($limit: Int = 100) {
query ConnectionsQuery($limit: Int = 100) @cached(ttl: 30) {
v0_connection_map(order_by: [
{status: asc},
{from_chain_id: asc},
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/cosmos-blocks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const cosmosBlocksQuery = graphql(/* GraphQL */ `
query CosmosBlocksQuery($limit: Int = 20) {
query CosmosBlocksQuery($limit: Int = 20) @cached(ttl: 1) {
data: v0_blocks(order_by: {time: desc}, limit: $limit) {
chain_id
hash
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/cosmos-transfers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const cosmosTransfersQuery = graphql(/* GraphQL */ `
query CosmosUnionTransfersQuery($address: String!, $limit: Int!) {
query CosmosUnionTransfersQuery($address: String!, $limit: Int!) @cached(ttl: 1) {
data: v0_cosmos_transfer(
limit: $limit,
order_by: { height: desc },
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/ibc-channels.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const ibcChannelMapQuery = graphql(/* graphql */ `
query IBCChannelMapQuery($limit: Int = 500, $status: String = "CONFIRM") {
query IBCChannelMapQuery($limit: Int = 500, $status: String = "CONFIRM") @cached(ttl: 30) {
data: v0_channel_map(limit: $limit, where: { status: { _eq: $status }}) {
from_chain_id
from_channel_id
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/ibc-clients.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const ibcClientMapQuery = graphql(/* graphql */ `
query IBCClientMapQuery($limit: Int = 600) {
query IBCClientMapQuery($limit: Int = 600) @cached(ttl: 30) {
data: v0_clients(limit: $limit) {
chain_id
client_id
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/ibc-connections.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const ibcConnectionMapQuery = graphql(/* graphql */ `
query IBCConnectionMapQuery($limit: Int = 500, $status: String = "CONFIRM") {
query IBCConnectionMapQuery($limit: Int = 500, $status: String = "CONFIRM") @cached(ttl: 30) {
data: v0_connection_map(limit: $limit, where: { status: { _eq: $status }}) {
from_chain_id
from_client_id
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/graphql/documents/ibc-packets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { graphql } from "gql.tada"

export const ibcRecvPacketQuery = graphql(/* graphql */ `
query IBCRecvPacketQuery($limit: Int = 10) {
query IBCRecvPacketQuery($limit: Int = 10) @cached(ttl: 1) {
v0_recv_packet(limit: $limit, order_by: { time: desc }) {
chain_id
block_hash
Expand Down

0 comments on commit 969a4df

Please sign in to comment.