# phirise

> CSV inputs to Graphql create mutations

Latest version **0.6.1** (published 2018-09-25) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.1 |
| Published | 2018-09-25 |
| First published | 2018-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 5.3 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Derek J Williams |
| Maintainers | derekjwilliams |
| Keywords | csv, graphql |

## Links

- npm: https://www.npmjs.com/package/phirise
- Repository: https://github.com/derekjwilliams/phirise
- Homepage: https://github.com/derekjwilliams/phirise#readme
- Issues: https://github.com/derekjwilliams/phirise/issues
- npm.io page: https://npm.io/package/phirise

## Dependencies (13)

- [moment](https://npm.io/package/moment.md) ^2.22.2
- [graphql](https://npm.io/package/graphql.md) ^14.0.2
- [json2csv](https://npm.io/package/json2csv.md) ^4.2.1
- [papaparse](https://npm.io/package/papaparse.md) ^4.6.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.2.0
- [common-tags](https://npm.io/package/common-tags.md) ^1.8.0
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^2.2.2
- [graphql-tag](https://npm.io/package/graphql-tag.md) ^2.9.2
- [apollo-boost](https://npm.io/package/apollo-boost.md) ^0.1.16
- [postgraphile](https://npm.io/package/postgraphile.md) ^4.0.0-rc.5.1
- [moment-parseplus](https://npm.io/package/moment-parseplus.md) ^1.1.1
- [eslint-plugin-graphql](https://npm.io/package/eslint-plugin-graphql.md) ^2.1.1
- [postgraphile-plugin-connection-filter](https://npm.io/package/postgraphile-plugin-connection-filter.md) ^1.0.0-beta.15

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.6.1 (latest) — 2018-09-25
- 0.6.0 — 2018-09-25
- 0.5.2 — 2018-09-20
- 0.5.1 — 2018-09-19
- 0.5.0 — 2018-09-19

## README

# Phirise

## Description

Convert a related set of CSV inputs to GraphQL mutations and Query Variables that can be used to send data to a GraphQL service.  The inverse, reading from graphQL service to set of CSV outputs is a future goal.  No user interface provided, see related projects for React 16+ and Angular 6+ user interface components.  Simple examples are provided in a separate repository for React and Angular using Apollo Client.

## Map Specification - Transform Template

Specifies The Mapping from input values in multiple CSV inputs to values in a graphql service.

## Postgraphile First

Initial implementation uses the schema generated by [Postgraphile](https://www.graphile.org/postgraphile/"Instant GraphQL API for PostgreSQL database").  

Additional implementations can be added by the user.

## Using Introspection to Make Life Easier

Example Queries:

### Get Type Information for a Specific Type

```
{
  __type(name: "StationaryAcousticValue") {
    kind
    name
    description
    fields {
      name
      description
      type {
        kind
        name
      }
      args {
        name
        description
      }
    }
  }
}
```


### Get a Schema

```
 {__schema {
   queryType {
     name
   }
}}
```

### Getting A  List Mutations with Input Names with types, and Return Types

```{
  __type(name: "Mutation") {
    fields {
      name
      description
      type {
        kind
        name
      }
      args {
        name
        type {
          ofType {
            kind
            name
            inputFields {
              name
              description
              type {
                ofType {
                  name
                  description
                }
              }
            }
          }
        }
      }
    }
  }
}
```

### A Single Element in the Result From the Above Introspection

```{
  "name": "createSite",
  "description": "Creates a single `Site`.",
  "type": {
    "kind": "OBJECT",
    "name": "CreateSitePayload"
  },
  "args": [
    {
      "name": "input",
      "type": {
        "ofType": {
          "kind": "INPUT_OBJECT",
          "name": "CreateSiteInput",
          "inputFields": [
            {
              "name": "clientMutationId",
              "description": "An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client.",
              "type": {
                "ofType": null
              }
            },
            {
              "name": "site",
              "description": "The `Site` to be created by this mutation.",
              "type": {
                "ofType": {
                  "name": "SiteInput",
                  "description": "An input for mutations affecting `Site`"
                }
              }
            }
          ]
        }
      }
    }
  ]
}
```

## Creating and Updating Values

### Create Value

#### Survey

```
mutation CreateSurvey($survey: CreateSurveyInput! ){
  createSurvey(input: $survey) {
    survey {
      id
    }
  }
}
```

Query Param:

```
{
  "survey": {
    "survey": {
      "projectId": -1,
      "startDate": "2017-06-28",
      "grtsId": 18
    }
  }
}
```

#### AcousticEvent



#### ClutterType

```
mutation CreateClutterType($ct: CreateClutterTypeInput! ){
  createClutterType(input: $ct) {
    clutterType {
      description
    }
  }
}
```

Query Param:

```
{
  "ct": {
    "clutterType": {
      "description": "Building"
    }
  }
}
```



### Update Value

#### ClutterType

```
  mutation UpdateClutterTypeDescription($ctd: UpdateClutterTypeInput!) {
  updateClutterType(input: $ctd) {
    clutterType {
      description
    }
  }
}
```

Query Param:

```
{
  "ctd": {
    "id": "WyJjbHV0dGVyX3R5cGVzIiwxXQ==",
    "clutterTypePatch": {
      "description": "Water"
    }

  }
}
```

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