# ghroth

> Artemis allows you to fetch data from your REST-API and provides Apollo-like Query & Mutation.

Latest version **1.0.0** (published 2019-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ghroth
pnpm add ghroth
yarn add ghroth
bun add ghroth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-06-11 |
| First published | 2019-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yofine |
| Maintainers | yofine |

## Links

- npm: https://www.npmjs.com/package/ghroth
- Repository: https://github.com/yofine/ghroth
- Homepage: https://github.com/yofine/Ghroth#readme
- Issues: https://github.com/yofine/Ghroth/issues
- npm.io page: https://npm.io/package/ghroth

## Recent versions

- 1.0.0 (latest) — 2019-06-11

## README

# Artemis
Artemis allows you to fetch data from your REST-API and provides Apollo-like Query & Mutation.

## Installation

```bash
npm i -S 'artemis-react'
```

## Usage

```js
import { ArtemisClient, ArtemisProvider } from 'artemis-react'

const client = ArtemisClient()
ReactDOM.render(
  <ArtemisProvider client={client}>
    <MyRootComponent />
  </ArtemisProvider>,
  document.getElementById('root'),
)
```


### render prop
```js
import { Query } from 'artemis-react'

const GET_POSTS = async () => {
  const posts = await fetch('/posts')
  return posts
}

const Posts = () => (
  <Query query={GET_POSTS}>
    {({ loading, error, data })} => {
      if (error) return `Error! ${error.message}`
      return (
        <Table 
          loading={loading}
          dataSource={data}
          columns={[...]}
        />
      )
    }	    
  </Query>
)
```

### react hooks

```js
import { useQuery } from 'artemis-react'

const GET_POSTS = async () => {
  const posts = await fetch('/posts')
  return posts
}

const Posts = () => {
  const { loading, error, data } = useQuery(GET_POSTS)
  if (error) return `Error! ${error.message}`
  return (
    <Table
      loading={loading}
      dataSource={data}
      columns={[...]}
    />
  )
}
```

---
_Source: https://npm.io/package/ghroth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
