Skip to content

Commit

Permalink
Updated dependencies, bump version v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
atulmy committed Jul 21, 2022
1 parent c042064 commit 16b7e45
Show file tree
Hide file tree
Showing 5 changed files with 2,006 additions and 3,237 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./node_modules/lint-staged/bin/lint-staged.js
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint && npm run build && npm run test
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

A simple helper function to generate GraphQL queries using plain JavaScript Objects (JSON).

<a href="https://www.npmjs.com/package/gql-query-builder">
<img src="https://img.shields.io/npm/dt/gql-query-builder?color=%23039be5&label=Downloads" alt="downloads" />
</a>

# Usage

### Install
Expand Down Expand Up @@ -156,31 +160,6 @@ query {
}
```

**Query with alias:**

```javascript
import * as gql from 'gql-query-builder'

const query = gql.query({
operation: {
name: 'thoughts',
alias: 'myThoughts',
},
fields: ['id', 'name', 'thought']
})

console.log(query)

// Output
query {
myThoughts: thoughts {
id,
name,
thought
}
}
```

**Query (with variables):**

```javascript
Expand Down Expand Up @@ -379,6 +358,31 @@ query {
}
```

**Query (with alias):**

```javascript
import * as gql from 'gql-query-builder'

const query = gql.query({
operation: {
name: 'thoughts',
alias: 'myThoughts',
},
fields: ['id', 'name', 'thought']
})

console.log(query)

// Output
query {
myThoughts: thoughts {
id,
name,
thought
}
}
```

**Query (with adapter defined):**

For example, to inject `SomethingIDidInMyAdapter` in the `operationWrapperTemplate` method.
Expand Down
Loading

0 comments on commit 16b7e45

Please sign in to comment.