diff --git a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Comment.jsx b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Comment.jsx index 42a673856..b0b0f9d7e 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Comment.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Comment.jsx @@ -1,6 +1,6 @@ const GRAPHQL_ENDPOINT = - "https://queryapi-hasura-graphql-24ktefolwq-ew.a.run.app"; -const APP_OWNER = "dev-queryapi.dataplatform.near"; + props.GRAPHQL_ENDPOINT || "https://near-queryapi.api.pagoda.co"; +const APP_OWNER = props.APP_OWNER || "dataplatform.near"; const accountId = props.accountId; const blockHeight = props.blockHeight === "now" ? "now" : parseInt(props.blockHeight); @@ -26,7 +26,7 @@ const commentUrl = `https://alpha.near.org/#/${APP_OWNER}/widget/QueryApi.Exampl if (!state.content && accountId && blockHeight !== "now") { const commentQuery = ` query CommentQuery { - roshaan_near_feed_indexer_comments( + dataplatform_near_feed_indexer_comments( where: {_and: {account_id: {_eq: "${accountId}"}, block_height: {_eq: ${blockHeight}}}} ) { content @@ -44,7 +44,7 @@ query CommentQuery { `${GRAPHQL_ENDPOINT}/v1/graphql`, { method: "POST", - headers: { "x-hasura-role": "roshaan_near" }, + headers: { "x-hasura-role": "dataplatform_near" }, body: JSON.stringify({ query: operationsDoc, variables: variables, @@ -57,7 +57,7 @@ query CommentQuery { fetchGraphQL(commentQuery, "CommentQuery", {}).then((result) => { if (result.status === 200) { if (result.body.data) { - const comments = result.body.data.roshaan_near_feed_indexer_comments; + const comments = result.body.data.dataplatform_near_feed_indexer_comments; if (comments.length > 0) { const comment = comments[0]; let content = JSON.parse(comment.content); diff --git a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.LikeButton.jsx b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.LikeButton.jsx index a0c79896d..1eddbda39 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.LikeButton.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.LikeButton.jsx @@ -1,7 +1,6 @@ - const GRAPHQL_ENDPOINT = - "https://queryapi-hasura-graphql-24ktefolwq-ew.a.run.app"; -const APP_OWNER = "dev-queryapi.dataplatform.near"; + props.GRAPHQL_ENDPOINT || "https://near-queryapi.api.pagoda.co"; +const APP_OWNER = props.APP_OWNER || "dataplatform.near"; const item = props.item; const likes = JSON.parse(props.likes?.length ? props.likes : "[]") ?? []; diff --git a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Post.jsx b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Post.jsx index c3817a435..2138f9751 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Post.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.Post.jsx @@ -1,6 +1,6 @@ const GRAPHQL_ENDPOINT = - "https://queryapi-hasura-graphql-24ktefolwq-ew.a.run.app"; -const APP_OWNER = "dev-queryapi.dataplatform.near"; + props.GRAPHQL_ENDPOINT || "https://near-queryapi.api.pagoda.co"; +const APP_OWNER = props.APP_OWNER || "dataplatform.near"; const accountId = props.accountId; const blockHeight = props.blockHeight === "now" ? "now" : parseInt(props.blockHeight); @@ -26,7 +26,7 @@ if (!state.content || !state.comments || !state.likes) { console.log("making call again"); const postsQuery = ` query IndexerQuery { - roshaan_near_feed_indexer_posts( + dataplatform_near_feed_indexer_posts( order_by: {block_height: desc} where: {_and: {block_height: {_eq: ${blockHeight}}, account_id: {_eq: "${accountId}"}}} ) { @@ -51,7 +51,7 @@ query IndexerQuery { `${GRAPHQL_ENDPOINT}/v1/graphql`, { method: "POST", - headers: { "x-hasura-role": "roshaan_near" }, + headers: { "x-hasura-role": "dataplatform_near" }, body: JSON.stringify({ query: operationsDoc, variables: variables, @@ -64,7 +64,7 @@ query IndexerQuery { fetchGraphQL(postsQuery, "IndexerQuery", {}).then((result) => { if (result.status === 200) { if (result.body.data) { - const posts = result.body.data.roshaan_near_feed_indexer_posts; + const posts = result.body.data.dataplatform_near_feed_indexer_posts; if (posts.length > 0) { const post = posts[0]; let content = JSON.parse(post.content); diff --git a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.PostPage.jsx b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.PostPage.jsx index d772ee4c1..b400f2166 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.PostPage.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.PostPage.jsx @@ -1,5 +1,5 @@ const GRAPHQL_ENDPOINT = - props.GRAPHQL_ENDPOINT || "https://queryapi-hasura-graphql-24ktefolwq-ew.a.run.app"; + props.GRAPHQL_ENDPOINT || "https://near-queryapi.api.pagoda.co"; const APP_OWNER = props.APP_OWNER || "dataplatform.near"; const accountId = props.accountId; const commentBlockHeight = parseInt(props.commentBlockHeight); @@ -13,7 +13,7 @@ State.init({ }); const parentPostByComment = `query ParentPostByComment { - roshaan_near_feed_indexer_comments( + dataplatform_near_feed_indexer_comments( where: {_and: {account_id: {_eq: "${accountId}"}, block_height: {_eq: ${commentBlockHeight}}}} ) { post { @@ -49,7 +49,7 @@ function fetchGraphQL(operationsDoc, operationName, variables) { `${GRAPHQL_ENDPOINT}/v1/graphql`, { method: "POST", - headers: { "x-hasura-role": "roshaan_near" }, + headers: { "x-hasura-role": "dataplatform_near" }, body: JSON.stringify({ query: operationsDoc, variables: variables, @@ -64,7 +64,7 @@ if (commentBlockHeight) { (result) => { if (result.status === 200) { if (result.body.data) { - const posts = result.body.data.roshaan_near_feed_indexer_comments; + const posts = result.body.data.dataplatform_near_feed_indexer_comments; if (posts.length > 0) { const post = posts[0].post; let content = JSON.parse(post.content); diff --git a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.jsx b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.jsx index 0d83123c8..b1a3515b3 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.Examples.Feed.jsx @@ -1,6 +1,5 @@ - const GRAPHQL_ENDPOINT = - props.GRAPHQL_ENDPOINT || "https://queryapi-hasura-graphql-24ktefolwq-ew.a.run.app"; + props.GRAPHQL_ENDPOINT || "https://near-queryapi.api.pagoda.co"; const APP_OWNER = props.APP_OWNER || "dataplatform.near"; const LIMIT = 10; const option = props.postsOrderOption ?? "blockHeight"; @@ -36,7 +35,7 @@ switch (option) { const indexerQueries = ` query GetPostsQuery($offset: Int) { - roshaan_near_feed_indexer_posts(order_by: [${querySortFilter} { block_height: desc }], offset: $offset, limit: ${LIMIT}) { + dataplatform_near_feed_indexer_posts(order_by: [${querySortFilter} { block_height: desc }], offset: $offset, limit: ${LIMIT}) { account_id block_height block_timestamp @@ -51,7 +50,7 @@ const indexerQueries = ` content } } - roshaan_near_feed_indexer_posts_aggregate { + dataplatform_near_feed_indexer_posts_aggregate { aggregate { count } @@ -64,7 +63,7 @@ function fetchGraphQL(operationsDoc, operationName, variables) { `${GRAPHQL_ENDPOINT}/v1/graphql`, { method: "POST", - headers: { "x-hasura-role": "roshaan_near" }, + headers: { "x-hasura-role": "dataplatform_near" }, body: JSON.stringify({ query: operationsDoc, variables: variables, @@ -112,10 +111,10 @@ const loadMorePosts = () => { if (result.status === 200) { let data = result.body.data; if (data) { - const newPosts = data.roshaan_near_feed_indexer_posts; + const newPosts = data.dataplatform_near_feed_indexer_posts; console.log(newPosts); const postsCount = - data.roshaan_near_feed_indexer_posts_aggregate.aggregate.count; + data.dataplatform_near_feed_indexer_posts_aggregate.aggregate.count; if (newPosts.length > 0) { State.update({ posts: [...state.posts, ...newPosts], diff --git a/frontend/widgets/examples/feed/src/QueryApi.Feed.jsx b/frontend/widgets/examples/feed/src/QueryApi.Feed.jsx index 42028338e..d05524aaa 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.Feed.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.Feed.jsx @@ -1,5 +1,5 @@ const GRAPHQL_ENDPOINT = - "https://queryapi-hasura-graphql-24ktefolwq-ew.a.run.app"; + "https://near-queryapi.api.pagoda.co"; const APP_OWNER = "dataplatform.near"; return ( diff --git a/frontend/widgets/examples/feed/src/QueryApi.dev.Feed.jsx b/frontend/widgets/examples/feed/src/QueryApi.dev.Feed.jsx index e6d76ebf4..507acabba 100644 --- a/frontend/widgets/examples/feed/src/QueryApi.dev.Feed.jsx +++ b/frontend/widgets/examples/feed/src/QueryApi.dev.Feed.jsx @@ -1,8 +1,7 @@ const GRAPHQL_ENDPOINT = - "https://queryapi-hasura-graphql-vcqilefdcq-ew.a.run.app"; + "https://near-queryapi.dev.api.pagoda.co"; const APP_OWNER = "dev-queryapi.dataplatform.near"; - return (