Skip to content

Commit

Permalink
chore: update files to new name and organization (#70)
Browse files Browse the repository at this point in the history
* chore: update files to new name and organization
* chore: fix npm badge
  • Loading branch information
baransu committed Jan 23, 2020
1 parent 1bc90d0 commit 5df9be8
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
@@ -1,4 +1,4 @@
name: graphql_ppx_re pipeline
name: graphql_ppx pipeline

on: [push, pull_request]

Expand Down
44 changes: 22 additions & 22 deletions CHANGELOG.md
@@ -1,62 +1,62 @@
## [0.5.0](https://github.com/baransu/graphql_ppx_re/compare/v0.4.9...v0.5.0) (2020-01-11)
## [0.5.0](https://github.com/reasonml-community/graphql_ppx/compare/v0.4.9...v0.5.0) (2020-01-11)

### Features

- Support configuration via ppx-flags, drop env based one ([3ed986e](https://github.com/baransu/graphql_ppx_re/commit/3ed986e7cf020e751ce93a46896f45c33e52c860))
- Move pipeline to one file, add esy cache ([b9517da9](https://github.com/baransu/graphql_ppx_re/commit/b9517da9d74e8e90b83808b6dfcc520f97fca7ea))
- Support configuration via ppx-flags, drop env based one ([3ed986e](https://github.com/reasonml-community/graphql_ppx/commit/3ed986e7cf020e751ce93a46896f45c33e52c860))
- Move pipeline to one file, add esy cache ([b9517da9](https://github.com/reasonml-community/graphql_ppx/commit/b9517da9d74e8e90b83808b6dfcc520f97fca7ea))

## [0.4.9](https://github.com/baransu/graphql_ppx_re/compare/v0.4.6...v0.4.9) (2020-01-06)
## [0.4.9](https://github.com/reasonml-community/graphql_ppx/compare/v0.4.6...v0.4.9) (2020-01-06)

### Bug Fixes

- ci: build linux binary on alpine with static linking ([9a4f31b](https://github.com/baransu/graphql_ppx_re/commit/9a4f31b76350bf73e108d31a5d6a75dc9a681238))
- ci: build linux binary on alpine with static linking ([9a4f31b](https://github.com/reasonml-community/graphql_ppx/commit/9a4f31b76350bf73e108d31a5d6a75dc9a681238))

## [0.4.1](https://github.com/baransu/graphql_ppx_re/compare/v0.4.0...v0.4.1) (2019-12-04)
## [0.4.1](https://github.com/reasonml-community/graphql_ppx/compare/v0.4.0...v0.4.1) (2019-12-04)

### Bug Fixes

- one field query with bs record ([e231d19](https://github.com/baransu/graphql_ppx_re/commit/e231d1970b69f175400a324e2542a4748588b34b))
- **bucklescript:** test suite upgrade and how to run tests documentation improved ([19db453](https://github.com/baransu/graphql_ppx_re/commit/19db453aef42f354f2e8f5cd532002ebfa66c22c))
- one field query with bs record ([e231d19](https://github.com/reasonml-community/graphql_ppx/commit/e231d1970b69f175400a324e2542a4748588b34b))
- **bucklescript:** test suite upgrade and how to run tests documentation improved ([19db453](https://github.com/reasonml-community/graphql_ppx/commit/19db453aef42f354f2e8f5cd532002ebfa66c22c))

### Features

- Multiple schemas support ([467d557](https://github.com/baransu/graphql_ppx_re/commit/467d55799771825b3fcdd3ccd4098c3a021328e9))
- Multiple schemas support ([467d557](https://github.com/reasonml-community/graphql_ppx/commit/467d55799771825b3fcdd3ccd4098c3a021328e9))

# [0.4.0](https://github.com/baransu/graphql_ppx_re/compare/v0.3.5...v0.4.0) (2019-11-25)
# [0.4.0](https://github.com/reasonml-community/graphql_ppx/compare/v0.3.5...v0.4.0) (2019-11-25)

### Features

- Unified definition - (parse, query, combineVariables) tuple to improve client side usage [8de2419](https://github.com/baransu/graphql_ppx_re/commit/8de241902cb660c830659ea659f56fce92ad423c)
- Unified definition - (parse, query, combineVariables) tuple to improve client side usage [8de2419](https://github.com/reasonml-community/graphql_ppx/commit/8de241902cb660c830659ea659f56fce92ad423c)

## [0.3.5](https://github.com/baransu/graphql_ppx_re/compare/v0.3.3...v0.3.5) (2019-11-23)
## [0.3.5](https://github.com/reasonml-community/graphql_ppx/compare/v0.3.3...v0.3.5) (2019-11-23)

### Bug Fixes

- explicit annotate custom scalar as Yojson.Basic.t for return type magic ([1fa67ae](https://github.com/baransu/graphql_ppx_re/commit/1fa67ae))
- explicit annotate custom scalar as Yojson.Basic.t for return type magic ([1fa67ae](https://github.com/reasonml-community/graphql_ppx/commit/1fa67ae))

### Features

- add `makeVariables` function ([667673c](https://github.com/baransu/graphql_ppx_re/commit/667673c7c815eb53ea26f7d9d06544439eae0f28))
- add `makeVariables` function ([667673c](https://github.com/reasonml-community/graphql_ppx/commit/667673c7c815eb53ea26f7d9d06544439eae0f28))

## [0.3.3](https://github.com/baransu/graphql_ppx_re/compare/v0.3.2...v0.3.3) (2019-11-23)
## [0.3.3](https://github.com/reasonml-community/graphql_ppx/compare/v0.3.2...v0.3.3) (2019-11-23)

### Bug Fixes

- remove `@bsField` directive from query output ([b3b17f3](https://github.com/baransu/graphql_ppx_re/commit/b3b17f3))
- **bucklescript:** polymorphic comparison on Js.Json.t ([d1897c2](https://github.com/baransu/graphql_ppx_re/commit/d1897c2))
- remove `@bsField` directive from query output ([b3b17f3](https://github.com/reasonml-community/graphql_ppx/commit/b3b17f3))
- **bucklescript:** polymorphic comparison on Js.Json.t ([d1897c2](https://github.com/reasonml-community/graphql_ppx/commit/d1897c2))

## [0.3.2](https://github.com/baransu/graphql_ppx_re/compare/v0.3.1...v0.3.2) (2019-10-21)
## [0.3.2](https://github.com/reasonml-community/graphql_ppx/compare/v0.3.1...v0.3.2) (2019-10-21)

### Bug Fixes

- improve schema reading (handle case where data is not in json schema) ([9324ba2](https://github.com/baransu/graphql_ppx_re/commit/9324ba232385540b61f485064ee09b1e49929146))
- improve schema reading (handle case where data is not in json schema) ([9324ba2](https://github.com/reasonml-community/graphql_ppx/commit/9324ba232385540b61f485064ee09b1e49929146))

## [0.3.1](https://github.com/baransu/graphql_ppx_re/compare/0.2.0...v0.3.1) (2019-10-19)
## [0.3.1](https://github.com/reasonml-community/graphql_ppx/compare/0.2.0...v0.3.1) (2019-10-19)

### Bug Fixes

- **tests:** change how tests are run ([8295a7e](https://github.com/baransu/graphql_ppx_re/commit/8295a7e))
- **tests:** change how tests are run ([8295a7e](https://github.com/reasonml-community/graphql_ppx/commit/8295a7e))

### Features

- **validation:** no undefined variables rule ([5d8772a](https://github.com/baransu/graphql_ppx_re/commit/5d8772a))
- **validation:** no undefined variables rule ([5d8772a](https://github.com/reasonml-community/graphql_ppx/commit/5d8772a))
28 changes: 14 additions & 14 deletions README.md
@@ -1,4 +1,4 @@
# graphql_ppx_re
# graphql_ppx

[![npm version](https://badge.fury.io/js/%40baransu%2Fgraphql_ppx_re.svg)](https://badge.fury.io/js/%40baransu%2Fgraphql_ppx_re)

Expand Down Expand Up @@ -35,10 +35,10 @@ If you want to use native version edit your `esy.json` file
```json
{
"dependencies": {
"@baransu/graphql_ppx_re": "*"
"graphql_ppx": "*"
},
"resolutions": {
"@baransu/graphql_ppx_re": "baransu/graphql_ppx_re:esy.json#<use latest stable commit from master>"
"graphql_ppx": "reasonml-community/graphql_ppx:esy.json#<use latest stable commit from master>"
}
}
```
Expand Down Expand Up @@ -67,19 +67,19 @@ to your backend. One of tools helping with it is [graphql-cli](https://www.npmjs

## Ignore `.graphql_ppx_cache` in your version control

`graphql_ppx_re` will generate a `.graphql_ppx_cache` folder alongside your JSON
`graphql_ppx` will generate a `.graphql_ppx_cache` folder alongside your JSON
schema to optimize parsing performance. If you're
using a version control system, you don't need to check it in.

# Limitations

While `graphql_ppx_re` covers a large portion of the GraphQL spec, there are still
While `graphql_ppx` covers a large portion of the GraphQL spec, there are still
some unsupported areas:

- Not all GraphQL validations are implemented. It will _not_ validate argument
types and do other sanity-checking of the queries. The fact that a query
compiles does not mean that it will pass server-side validation.
- Fragment support is limited and not 100% safe - because `graphql_ppx_re` only can
- Fragment support is limited and not 100% safe - because `graphql_ppx` only can
perform local reasoning on queries, you can construct queries with fragments
that are invalid.

Expand All @@ -103,7 +103,7 @@ some unsupported areas:

# Extra features

By using some directives prefixed `bs`, `graphql_ppx_re` lets you modify how the
By using some directives prefixed `bs`, `graphql_ppx` lets you modify how the
result of a query is parsed. All these directives will be removed from the query
at compile time, so your server doesn't have to support them.

Expand All @@ -115,7 +115,7 @@ syntax or pattern match on their contents. Since they are not named, they also
result in quite large type error messages when there are mismatches.

Reason/OCaml records, on the other hand, can be pattern matched, created using the
spread syntax, and give nicer error messages when they mismatch. `graphql_ppx_re`
spread syntax, and give nicer error messages when they mismatch. `graphql_ppx`
gives you the option to decode a field as a record using the `@bsRecord`
directive:

Expand All @@ -138,7 +138,7 @@ module HeroQuery = [%graphql {|
```

Note that the record has to already exist and be in scope for this to work.
`graphql_ppx_re` will not _create_ the record. Even though this involves some
`graphql_ppx` will not _create_ the record. Even though this involves some
duplication of both names and types, type errors will be generated if there are
any mismatches.

Expand Down Expand Up @@ -280,7 +280,7 @@ nodes {
}
```

This is because we allow querying union fields only in certain cases. GraphQL provides the `__typename` field but it's not present in GraphQL introspection query thus `graphql_ppx_re` doesn't know that this field exists.
This is because we allow querying union fields only in certain cases. GraphQL provides the `__typename` field but it's not present in GraphQL introspection query thus `graphql_ppx` doesn't know that this field exists.
To fix your query simply remove `__typename`. It's added behinds a scene as an implementation detail and serves us as a way to decide which case to select when parsing your query result.

This is an example of a correct query:
Expand All @@ -300,11 +300,11 @@ nodes {

# Configuration

If you need to customize certain features of `graphql_ppx_re` you can provide ppx arguments to do so:
If you need to customize certain features of `graphql_ppx` you can provide ppx arguments to do so:

### -apollo-mode

By default `graphql_ppx_re` adds `__typename` only to fields on which we need those informations (Unions and Interfaces). If you want to add `__typename` on every object in a query you can specify it by using `-apollo-mode` in `ppx-flags`. It's usefull in case of using `apollo-client` because of it's cache.
By default `graphql_ppx` adds `__typename` only to fields on which we need those informations (Unions and Interfaces). If you want to add `__typename` on every object in a query you can specify it by using `-apollo-mode` in `ppx-flags`. It's usefull in case of using `apollo-client` because of it's cache.

```json
"ppx-flags": [
Expand All @@ -314,7 +314,7 @@ By default `graphql_ppx_re` adds `__typename` only to fields on which we need th

### -schema

By default `graphql_ppx_re` uses `graphql_schema.json` file from your root directory. You can override it by providing `-schema` argument in `ppx-flags` to overriding it.
By default `graphql_ppx` uses `graphql_schema.json` file from your root directory. You can override it by providing `-schema` argument in `ppx-flags` to overriding it.

```json
"ppx-flags": [
Expand Down Expand Up @@ -348,7 +348,7 @@ This opens up the possibility to use multiple different GraphQL APIs in the same

# Supported platforms

`graphql_ppx_re` somes with prebuild binaries for `linux-x64`, `darwin-x64` and `win-x64`. If you need support for other platform, please open an issue.
`graphql_ppx` somes with prebuild binaries for `linux-x64`, `darwin-x64` and `win-x64`. If you need support for other platform, please open an issue.

# Contributing

Expand Down
2 changes: 1 addition & 1 deletion dune-project
@@ -1,3 +1,3 @@
(lang dune 1.0)

(name "graphql_ppx_re")
(name "graphql_ppx")

0 comments on commit 5df9be8

Please sign in to comment.