mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
documentation and cleanup
This commit is contained in:
parent
7e0db7c3a1
commit
6eaf7619b9
24
README.md
24
README.md
@ -146,6 +146,30 @@ vi .env.development
|
|||||||
# GITHUB_TOKEN=ADD-YOUR-TOKEN-HERE
|
# GITHUB_TOKEN=ADD-YOUR-TOKEN-HERE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When running the site locally, you can use the GraphiQL client running under [localhost:8000/\_\_\_graphql](http://localhost:8000/___graphql).
|
||||||
|
|
||||||
|
<img width="982" alt="screen shot 2018-11-10 at 18 41 45" src="https://user-images.githubusercontent.com/90316/48304718-66b94e80-e51e-11e8-8333-e5cadbf4d4b8.png">
|
||||||
|
|
||||||
|
This query should get you started to explore what information you can get:
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
query {
|
||||||
|
github {
|
||||||
|
organization(login: "oceanprotocol") {
|
||||||
|
repositories(first: 100) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
name
|
||||||
|
description
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
- Troy McConaghy ([@ttmc](https://github.com/ttmc)) - [Ocean Protocol](https://oceanprotocol.com)
|
- Troy McConaghy ([@ttmc](https://github.com/ttmc)) - [Ocean Protocol](https://oceanprotocol.com)
|
||||||
|
@ -7,7 +7,7 @@ const queryGithub = graphql`
|
|||||||
query GitHubReposInfo {
|
query GitHubReposInfo {
|
||||||
github {
|
github {
|
||||||
organization(login: "oceanprotocol") {
|
organization(login: "oceanprotocol") {
|
||||||
repositories(first: 100) {
|
repositories(first: 100, isFork: false) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
name
|
name
|
||||||
@ -29,24 +29,25 @@ const Repository = ({ name, links }) => (
|
|||||||
data.github.organization.repositories.edges
|
data.github.organization.repositories.edges
|
||||||
|
|
||||||
// just iterate over all repos until we have a name match,
|
// just iterate over all repos until we have a name match,
|
||||||
// then return that repo
|
// then return that repo, and then filter out all empty nodes
|
||||||
const repoFilteredArray = repositoriesGitHub
|
let repoFilteredArray = repositoriesGitHub
|
||||||
.map(({ node }) => {
|
.map(({ node }) => {
|
||||||
if (node.name === name) return node
|
if (node.name === name) return node
|
||||||
})
|
})
|
||||||
.filter(el => el != null)
|
.filter(n => n)
|
||||||
|
|
||||||
const repo = Object.assign(...repoFilteredArray)
|
const repo = repoFilteredArray[0]
|
||||||
|
const { url, description } = repo
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.repository}>
|
<div className={styles.repository}>
|
||||||
<h1 className={styles.repositoryName}>{name}</h1>
|
<h1 className={styles.repositoryName}>{name}</h1>
|
||||||
|
|
||||||
<p>{!repo ? '...' : repo.description}</p>
|
<p>{!description ? '...' : description}</p>
|
||||||
|
|
||||||
<ul className={styles.repositoryLinks}>
|
<ul className={styles.repositoryLinks}>
|
||||||
<li>
|
<li>
|
||||||
<a href={repo.url}>GitHub</a>
|
<a href={url}>GitHub</a>
|
||||||
</li>
|
</li>
|
||||||
{links &&
|
{links &&
|
||||||
links.map(link => (
|
links.map(link => (
|
||||||
|
@ -14,8 +14,6 @@ const RepositoryList = ({ repositories }) => (
|
|||||||
<Repository
|
<Repository
|
||||||
key={item.name}
|
key={item.name}
|
||||||
name={item.name}
|
name={item.name}
|
||||||
description={item.description}
|
|
||||||
url={item.url}
|
|
||||||
links={item.links}
|
links={item.links}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -49,31 +49,11 @@ const query = graphql`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
// const queryGithub = graphql`
|
|
||||||
// query {
|
|
||||||
// github {
|
|
||||||
// organization(login: "oceanprotocol") {
|
|
||||||
// repositories(first: 100) {
|
|
||||||
// edges {
|
|
||||||
// node {
|
|
||||||
// id
|
|
||||||
// name
|
|
||||||
// description
|
|
||||||
// url
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// `
|
|
||||||
|
|
||||||
const Repositories = () => (
|
const Repositories = () => (
|
||||||
<StaticQuery
|
<StaticQuery
|
||||||
query={query}
|
query={query}
|
||||||
render={data => {
|
render={data => {
|
||||||
const repositories = data.allRepositoriesYaml.edges
|
const repositories = data.allRepositoriesYaml.edges
|
||||||
// const repositoriesGitHub = data.github.organization.repositories.edges
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.repositories}>
|
<div className={styles.repositories}>
|
||||||
|
Loading…
Reference in New Issue
Block a user