Skip to content

Commit 5fee8c5

Browse files
committed
Add @tpucci as a contributor
1 parent 8d6e390 commit 5fee8c5

2 files changed

Lines changed: 87 additions & 1 deletion

File tree

.all-contributorsrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"projectName": "react-native-graphql-transformer",
3+
"projectOwner": "bamlab",
4+
"files": [
5+
"README.md"
6+
],
7+
"imageSize": 100,
8+
"commit": true,
9+
"contributors": [
10+
{
11+
"login": "tpucci",
12+
"name": "Thomas Pucci",
13+
"avatar_url": "https://avatars1.githubusercontent.com/u/16262904?v=4",
14+
"profile": "https://github.com/tpucci",
15+
"contributions": [
16+
"code",
17+
"doc",
18+
"example"
19+
]
20+
}
21+
]
22+
}

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,66 @@
11
# react-native-graphql-transformer
2-
Transform GraphQL source files
2+
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)
3+
4+
Seamlessly use GraphQL files with react-native >= 0.45
5+
6+
## Foreword
7+
8+
This package is inspired by the
9+
[react-native-typescript-transform](https://github.com/ds300/@bam.tech/react-native-graphql-transformer)
10+
repository.
11+
12+
## Goal
13+
14+
Use `.gql`or `.graphql` files with React Native packager for better readability
15+
and separation of concerns.
16+
17+
**Exemple of a `.gql` file with import statement:**
18+
19+
```gql
20+
#import "fragments/BasePost.gql"
21+
22+
query PostListItemQuery($id: ID) {
23+
Post(id: $id) {
24+
...BasePost
25+
}
26+
}
27+
```
28+
29+
## Usage
30+
31+
### Step 1: Install
32+
33+
yarn add -D @bam.tech/react-native-graphql-transformer
34+
35+
### Step 2: Configure the react native packager
36+
37+
Add this to your rn-cli.config.js (make one if you don't have one already):
38+
39+
```js
40+
module.exports = {
41+
getTransformModulePath() {
42+
return require.resolve("@bam.tech/react-native-graphql-transformer");
43+
},
44+
getSourceExts() {
45+
return ["gql", "graphql"];
46+
}
47+
};
48+
```
49+
50+
If you need to run the packager directly from the command line, run the
51+
following
52+
53+
react-native start --transformer node_modules/@bam.tech/react-native-graphql-transformer/index.js --sourceExts gql,graphql
54+
55+
### Step 3: Write GraphQL code!
56+
57+
## Contributors
58+
59+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
60+
<!-- prettier-ignore -->
61+
| [<img src="https://avatars1.githubusercontent.com/u/16262904?v=4" width="100px;"/><br /><sub><b>Thomas Pucci</b></sub>](https://github.com/tpucci)<br />[💻](https://github.com/bamlab/react-native-graphql-transformer/commits?author=tpucci "Code") [📖](https://github.com/bamlab/react-native-graphql-transformer/commits?author=tpucci "Documentation") [💡](#example-tpucci "Examples") |
62+
| :---: |
63+
<!-- ALL-CONTRIBUTORS-LIST:END -->
64+
## License
65+
66+
MIT

0 commit comments

Comments
 (0)