1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Issue-#850: Rest api

This commit is contained in:
Akshay 2022-02-23 18:32:18 +01:00
parent cee06030d8
commit b4663c125a

View File

@ -103,6 +103,34 @@ exports.createPages = ({ graphql, actions }) => {
}
}
}
aquariusRestApi: allMarkdownRemark(
filter: {
frontmatter: {
title: { eq: "API.md" }
app: { eq: "aquarius" }
}
}
) {
edges {
node {
id
html
htmlAst
tableOfContents
frontmatter {
title
description
slug
section
app
module
source
version
}
}
}
}
}
`
).then(async (result) => {
@ -165,27 +193,24 @@ exports.createPages = ({ graphql, actions }) => {
const providerList = filterMarkdownList(markdowns, 'provider')
const subgraphList = filterMarkdownList(markdowns, 'ocean-subgraph')
const aquariusRestApi = getRestApiPageFromMarkdownList(
markdowns,
'aquarius'
)[0].node
console.log('Aquarius rest api', result.data.aquariusRestApi)
const aquariusRestApi = result.data.aquariusRestApi.edges[0].node
await createRestApiPage(
createPage,
aquariusRestApi,
`/references/aquarius-rest-api`
)
const providerRestApi = getRestApiPageFromMarkdownList(
markdowns,
'provider'
)[0].node
// const providerRestApi = getRestApiPageFromMarkdownList(
// markdowns,
// 'provider'
// )[0].node
await createRestApiPage(
createPage,
providerRestApi,
`/references/provider-rest-api`
)
// await createRestApiPage(
// createPage,
// providerRestApi,
// `/references/provider-rest-api`
// )
await createReadTheDocsPage(createPage, 'ocean-py', oceanPyList)
await createReadTheDocsPage(createPage, 'provider', providerList)
@ -327,9 +352,9 @@ const createRestApiPage = async (createPage, node, slug) => {
})
}
const getRestApiPageFromMarkdownList = (markdownList, string) => {
return markdownList.filter(
({ node }) =>
node.frontmatter.app === string && node.frontmatter.slug === 'API.md'
)
}
// const getRestApiPageFromMarkdownList = (markdownList, string) => {
// return markdownList.filter(
// ({ node }) =>
// node.frontmatter.app === string && node.frontmatter.slug === 'API.md'
// )
// }