1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-06-26 03:06:27 +02:00

documentation and cleanup

This commit is contained in:
Matthias Kretschmann 2018-11-10 19:27:27 +01:00
parent 7e0db7c3a1
commit 6eaf7619b9
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 32 additions and 29 deletions

View File

@ -146,6 +146,30 @@ vi .env.development
# 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
- Troy McConaghy ([@ttmc](https://github.com/ttmc)) - [Ocean Protocol](https://oceanprotocol.com)

View File

@ -7,7 +7,7 @@ const queryGithub = graphql`
query GitHubReposInfo {
github {
organization(login: "oceanprotocol") {
repositories(first: 100) {
repositories(first: 100, isFork: false) {
edges {
node {
name
@ -29,24 +29,25 @@ const Repository = ({ name, links }) => (
data.github.organization.repositories.edges
// just iterate over all repos until we have a name match,
// then return that repo
const repoFilteredArray = repositoriesGitHub
// then return that repo, and then filter out all empty nodes
let repoFilteredArray = repositoriesGitHub
.map(({ 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 (
<div className={styles.repository}>
<h1 className={styles.repositoryName}>{name}</h1>
<p>{!repo ? '...' : repo.description}</p>
<p>{!description ? '...' : description}</p>
<ul className={styles.repositoryLinks}>
<li>
<a href={repo.url}>GitHub</a>
<a href={url}>GitHub</a>
</li>
{links &&
links.map(link => (

View File

@ -14,8 +14,6 @@ const RepositoryList = ({ repositories }) => (
<Repository
key={item.name}
name={item.name}
description={item.description}
url={item.url}
links={item.links}
/>
))}

View File

@ -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 = () => (
<StaticQuery
query={query}
render={data => {
const repositories = data.allRepositoriesYaml.edges
// const repositoriesGitHub = data.github.organization.repositories.edges
return (
<div className={styles.repositories}>